[hackers] [dwm] some hotfix cleanup related to wild selmon-> destruction || Anselm R Garbe

From: <hg_AT_suckless.org>
Date: Wed, 24 Jun 2009 10:14:57 +0000 (UTC)

changeset: 1413:e0b1ca478d40
tag: tip
user: Anselm R Garbe <garbeam_AT_gmail.com>
date: Wed Jun 24 11:14:51 2009 +0100
files: dwm.c
description:
some hotfix cleanup related to wild selmon-> destruction

diff -r 2bc44743117e -r e0b1ca478d40 dwm.c
--- a/dwm.c Tue Jun 23 19:09:30 2009 +0100
+++ b/dwm.c Wed Jun 24 11:14:51 2009 +0100
@@ -1,4 +1,4 @@
-#define XINULATOR /* debug, simulates dual head */
+//#define XINULATOR /* debug, simulates dual head */
 /* See LICENSE file for copyright and license details.
  *
  * dynamic window manager is designed like any other X client as well. It is
@@ -1649,9 +1649,11 @@
 
 void
 updategeom(void) {
- int i, n = 1;
+ int i, di, n = 1, x, y;
+ unsigned int dui;
         Client *c;
         Monitor *newmons = NULL, *m, *tm;
+ Window dummy;
 
 #ifdef XINULATOR
         n = 2;
@@ -1720,16 +1722,6 @@
                 m->showbar = showbar;
                 m->topbar = topbar;
                 updatebarpos(m);
- /* reassign all clients with same screen number */
- for(tm = mons; tm; tm = tm->next)
- if(tm->screen_number == m->screen_number) {
- m->clients = tm->clients;
- m->sel = m->stack = tm->stack;
- tm->clients = NULL;
- tm->stack = NULL;
- for(c = m->clients; c; c = c->next)
- c->mon = m;
- }
         }
 
         /* reassign left over clients of disappeared monitors */
@@ -1744,18 +1736,13 @@
         }
 
         /* select focused monitor */
- if(!selmon) {
- selmon = newmons;
- int di, x, y;
- unsigned int dui;
- Window dummy;
- if(XQueryPointer(dpy, root, &dummy, &dummy, &x, &y, &di, &di, &dui))
- for(m = newmons; m; m = m->next)
- if(INRECT(x, y, m->wx, m->wy, m->ww, m->wh)) {
- selmon = m;
- break;
- }
- }
+ selmon = newmons;
+ if(XQueryPointer(dpy, root, &dummy, &dummy, &x, &y, &di, &di, &dui))
+ for(m = newmons; m; m = m->next)
+ if(INRECT(x, y, m->wx, m->wy, m->ww, m->wh)) {
+ selmon = m;
+ break;
+ }
 
         /* final assignment of new monitors */
         cleanupmons();
Received on Wed Jun 24 2009 - 10:14:57 UTC

This archive was generated by hypermail 2.2.0 : Wed Jun 24 2009 - 10:24:05 UTC