Fix #81, this should now work correctly.

* Put old (broken) simpleswitcher code back.
        * Fix call to window_get_prop
        * Translate address with XTranslateCoordinates.
This commit is contained in:
QC 2014-09-05 17:14:50 +02:00
parent 20dca49a22
commit 10322b45a5
1 changed files with 22 additions and 5 deletions

View File

@ -615,6 +615,23 @@ void monitor_active ( workarea *mon )
Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) );
int x, y;
Window id;
Atom type;
int count;
if ( window_get_prop ( root, netatoms[_NET_ACTIVE_WINDOW], &type, &count, &id, sizeof ( Window ) )
&& type == XA_WINDOW && count > 0 ) {
XWindowAttributes *attr = window_get_attributes ( id );
if ( attr != NULL ) {
Window junkwin;
if ( XTranslateCoordinates ( display, id, attr->root,
-attr->border_width,
-attr->border_width,
&x, &y, &junkwin ) == True ) {
monitor_dimensions ( screen, x, y, mon );
return;
}
}
}
if ( pointer_get ( root, &x, &y ) ) {
monitor_dimensions ( screen, x, y, mon );
return;