diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-04-29 21:42:31 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-04-29 21:42:31 +0200 |
commit | 09d1955338ea8c0d491ab0b286a4762cdbae9da2 (patch) | |
tree | 39a86150a209cd9c9fc7f2ea3de77f2268d23795 /source/x11-helper.c | |
parent | 91e68f4ded19ffb025f5347156cdf64d2e4c4e7f (diff) |
Issue: #395 adding more options.
Diffstat (limited to 'source/x11-helper.c')
-rw-r--r-- | source/x11-helper.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/x11-helper.c b/source/x11-helper.c index 09306deb..9ccb5871 100644 --- a/source/x11-helper.c +++ b/source/x11-helper.c @@ -259,7 +259,7 @@ void monitor_active ( workarea *mon ) } // Get the current desktop. unsigned int current_desktop = 0; - if ( config.monitor != -2 && xcb_ewmh_get_current_desktop_reply ( &xcb->ewmh, + if ( config.monitor == -1 && xcb_ewmh_get_current_desktop_reply ( &xcb->ewmh, xcb_ewmh_get_current_desktop ( &xcb->ewmh, xcb->screen_nbr ), ¤t_desktop, NULL ) ) { xcb_get_property_cookie_t c = xcb_ewmh_get_desktop_viewport ( &xcb->ewmh, xcb->screen_nbr ); @@ -282,10 +282,10 @@ void monitor_active ( workarea *mon ) xcb_get_geometry_cookie_t c = xcb_get_geometry ( xcb->connection, active_window ); xcb_get_geometry_reply_t *r = xcb_get_geometry_reply ( xcb->connection, c, NULL ); if ( r ) { - if ( config.monitor == -2 ) { - xcb_translate_coordinates_cookie_t ct = xcb_translate_coordinates ( xcb->connection, active_window, root, r->x, r->y ); - xcb_translate_coordinates_reply_t *t = xcb_translate_coordinates_reply ( xcb->connection, ct, NULL ); - if ( t ) { + xcb_translate_coordinates_cookie_t ct = xcb_translate_coordinates ( xcb->connection, active_window, root, r->x, r->y ); + xcb_translate_coordinates_reply_t *t = xcb_translate_coordinates_reply ( xcb->connection, ct, NULL ); + if ( t ) { + if ( config.monitor == -2 ) { // place the menu above the window // if some window is focused, place menu above window, else fall // back to selected monitor. @@ -300,11 +300,15 @@ void monitor_active ( workarea *mon ) free ( r ); free ( t ); return; + } else if ( config.monitor == -4 ){ + monitor_dimensions ( t->dst_x, t->dst_y, mon ); + free(r); + free(t); + return; + } } - monitor_dimensions ( r->x, r->y, mon ); free ( r ); - return; } } if ( pointer_get ( root, &x, &y ) ) { |