mirror of https://github.com/0intro/wmii
Set the focus properly when removing a client from the selected area
This commit is contained in:
parent
98d10dccac
commit
0e1cba7e96
4
Makefile
4
Makefile
|
@ -3,8 +3,8 @@
|
|||
|
||||
include config.mk
|
||||
|
||||
SRC = area.c bar.c client.c column.c draw.c event.c \
|
||||
frame.c fs.c geom.c key.c main.c mouse.c rule.c util.c view.c
|
||||
SRC = area.c bar.c client.c column.c draw.c event.c frame.c fs.c \
|
||||
geom.c key.c main.c mouse.c rule.c util.c view.c
|
||||
OBJ = ${SRC:.c=.o}
|
||||
|
||||
all: options wmiiwm
|
||||
|
|
16
area.c
16
area.c
|
@ -171,10 +171,16 @@ detach_from_area(Area *a, Frame *f) {
|
|||
for(pr = a->frame; pr; pr = pr->anext)
|
||||
if(pr->anext == f) break;
|
||||
remove_frame(f);
|
||||
if(a->sel == f)
|
||||
a->sel = pr;
|
||||
if(a->sel == nil)
|
||||
a->sel = a->frame;
|
||||
|
||||
if(a->sel == f) {
|
||||
if(!pr)
|
||||
pr = a->frame;
|
||||
if((a->view == screen->sel) &&
|
||||
(a->view->sel == a) && (pr))
|
||||
focus_frame(pr, False);
|
||||
else
|
||||
a->sel = pr;
|
||||
}
|
||||
|
||||
if(!a->floating) {
|
||||
if(a->frame)
|
||||
|
@ -334,7 +340,7 @@ focus_area(Area *a) {
|
|||
|
||||
if(f) {
|
||||
draw_frame(f);
|
||||
XSetInputFocus(blz.dpy, f->client->win, RevertToPointerRoot, CurrentTime);
|
||||
XSetInputFocus(blz.dpy, f->client->win, RevertToParent, CurrentTime);
|
||||
}else
|
||||
XSetInputFocus(blz.dpy, screen->barwin, RevertToPointerRoot, CurrentTime);
|
||||
|
||||
|
|
9
client.c
9
client.c
|
@ -307,9 +307,9 @@ set_urgent(Client *c, Bool urgent, Bool write) {
|
|||
XWMHints *wmh;
|
||||
char *cwrite;
|
||||
|
||||
cwrite = "Manager";
|
||||
cwrite = "Client";
|
||||
if(write)
|
||||
cwrite = "Client";
|
||||
cwrite = "Manager";
|
||||
|
||||
if(urgent != c->urgent) {
|
||||
if(urgent)
|
||||
|
@ -361,7 +361,7 @@ prop_client(Client *c, XPropertyEvent *e) {
|
|||
break;
|
||||
case XA_WM_HINTS:
|
||||
wmh = XGetWMHints(blz.dpy, c->win);
|
||||
set_urgent(c, (wmh->flags & XUrgencyHint), False);
|
||||
set_urgent(c, (wmh->flags & XUrgencyHint) != 0, False);
|
||||
XFree(wmh);
|
||||
break;
|
||||
}
|
||||
|
@ -454,7 +454,6 @@ destroy_client(Client *c) {
|
|||
}
|
||||
|
||||
update_client_views(c, &dummy);
|
||||
update_views();
|
||||
|
||||
unmap_client(c, WithdrawnState);
|
||||
reparent_client(c, blz.root, c->rect.x, c->rect.y);
|
||||
|
@ -591,8 +590,8 @@ resize_client(Client *c, XRectangle *r) {
|
|||
c->rect.width, c->rect.height);
|
||||
map_client(c);
|
||||
map_frame(c);
|
||||
configure_client(c);
|
||||
}
|
||||
configure_client(c);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
1
event.c
1
event.c
|
@ -6,7 +6,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <X11/keysym.h>
|
||||
#include "printevent.h"
|
||||
|
||||
uint
|
||||
flush_masked_events(long even_mask) {
|
||||
|
|
2
frame.c
2
frame.c
|
@ -181,7 +181,7 @@ focus_frame(Frame *f, Bool restack) {
|
|||
return;
|
||||
|
||||
if(a == old_a) {
|
||||
XSetInputFocus(blz.dpy, f->client->win, RevertToPointerRoot, CurrentTime);
|
||||
XSetInputFocus(blz.dpy, f->client->win, RevertToParent, CurrentTime);
|
||||
draw_frame(f);
|
||||
}
|
||||
else if(old_in_a)
|
||||
|
|
|
@ -43,6 +43,7 @@ can get it touch with me at the following location:
|
|||
ken@richsun.UUCP
|
||||
*/
|
||||
|
||||
#include "wmii.h"
|
||||
#include <stdio.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
@ -852,7 +853,10 @@ char *eventtype(XEvent *ev)
|
|||
void printevent(XEvent *e)
|
||||
{
|
||||
XAnyEvent *ev = (void*)e;
|
||||
Client *c;
|
||||
|
||||
if(ev->window && (c = client_of_win(ev->window)))
|
||||
printf("title=%s\n", c->name);
|
||||
printf("%3ld %-20s ", ev->serial, eventtype(e));
|
||||
if(ev->send_event)
|
||||
printf("(sendevent) ");
|
||||
|
|
Loading…
Reference in New Issue