mirror of
https://github.com/0intro/wmii
synced 2024-11-22 05:42:05 +03:00
Destroy empty areas on non-primary Xinerama screens when emptying them via the mouse. Fixes issue #84.
This commit is contained in:
parent
e66f742e75
commit
7b61725510
@ -455,8 +455,7 @@ thcol(Frame *f) {
|
||||
}
|
||||
|
||||
|
||||
/* XXX: Multihead. */
|
||||
if(!a->frame && !a->floating && f->view->firstarea->next)
|
||||
if(!a->frame && !a->floating && a->view->areas[a->screen]->next)
|
||||
area_destroy(a);
|
||||
|
||||
frame_focus(f);
|
||||
|
@ -46,16 +46,28 @@ xext_event(XEvent *e) {
|
||||
handle(e, randr_handlers, randr_eventbase);
|
||||
}
|
||||
|
||||
static void
|
||||
randr_applyrotation(int rotation, int width, int height) {
|
||||
if(rotation+90 % 180)
|
||||
scr.rect = Rect(0, 0, width, height);
|
||||
else
|
||||
scr.rect = Rect(0, 0, height, width);
|
||||
}
|
||||
|
||||
static void
|
||||
randr_init(void) {
|
||||
int errorbase, major, minor;
|
||||
Rotation rotation;
|
||||
|
||||
have_RandR = XRRQueryExtension(display, &randr_eventbase, &errorbase);
|
||||
if(have_RandR)
|
||||
if(XRRQueryVersion(display, &major, &minor) && major < 1)
|
||||
have_RandR = false;
|
||||
if(have_RandR)
|
||||
if(have_RandR) {
|
||||
XRRSelectInput(display, scr.root.xid, RRScreenChangeNotifyMask);
|
||||
XRRRotations(display, scr.screen, &rotation);
|
||||
randr_applyrotation(rotation, Dx(scr.rect), Dy(scr.rect));
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -68,10 +80,7 @@ static void
|
||||
randr_screenchange(XRRScreenChangeNotifyEvent *ev) {
|
||||
|
||||
XRRUpdateConfiguration((XEvent*)ev);
|
||||
if(ev->rotation+90 % 180)
|
||||
scr.rect = Rect(0, 0, ev->width, ev->height);
|
||||
else
|
||||
scr.rect = Rect(0, 0, ev->height, ev->width);
|
||||
randr_applyrotation(ev->rotation, ev->width, ev->height);
|
||||
init_screens();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user