mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
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:
parent
20dca49a22
commit
10322b45a5
1 changed files with 22 additions and 5 deletions
|
@ -615,6 +615,23 @@ void monitor_active ( workarea *mon )
|
||||||
Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) );
|
Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) );
|
||||||
int x, y;
|
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 ) ) {
|
if ( pointer_get ( root, &x, &y ) ) {
|
||||||
monitor_dimensions ( screen, x, y, mon );
|
monitor_dimensions ( screen, x, y, mon );
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue