]> Pileus Git - wmpus/commitdiff
Add auto-focus for primary monitor
authorAndy Spencer <andy753421@gmail.com>
Wed, 26 Oct 2011 05:25:54 +0000 (05:25 +0000)
committerAndy Spencer <andy753421@gmail.com>
Wed, 26 Oct 2011 06:32:49 +0000 (06:32 +0000)
sys-win32.c
wm-wmii.c

index 6d57bb6c1d77ec49179e3a16994c9eedc9034a06..8e34940c22da440489f9af14c88ae5d1be7be864 100644 (file)
@@ -295,6 +295,7 @@ BOOL CALLBACK MonProc(HMONITOR mon, HDC dc, LPRECT rect, LPARAM _screens)
        win_t *screen = new0(win_t);
        screen->x = work->left;
        screen->y = work->top;
+       screen->z = !!(info.dwFlags & MONITORINFOF_PRIMARY);
        screen->w = work->right  - work->left;
        screen->h = work->bottom - work->top;
        *screens = list_append(*screens, screen);
index 38a37250fea5441fa7518956b9036c13f1a32f25..90ec4e174a97d597e0995d30b32f9259bc182726 100644 (file)
--- a/wm-wmii.c
+++ b/wm-wmii.c
@@ -556,6 +556,9 @@ static tag_t *tag_new(list_t *screens, int name)
                tag->dpys = list_append(tag->dpys, dpy);
        }
        tag->dpy  = tag->dpys->data;
+       for (list_t *dpy = tag->dpys; dpy; dpy = dpy->next)
+               if (DPY(dpy)->geom->z > tag->dpy->geom->z)
+                       tag->dpy = dpy->data;
        return tag;
 }