1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-11 13:50:48 -05:00

Add option to position rofi at mouse

This commit is contained in:
Dave Davenport 2016-03-05 23:01:16 +01:00
parent 989e208d3c
commit f4f2e3d129
2 changed files with 9 additions and 2 deletions

View file

@ -87,7 +87,7 @@ dnl ---------------------------------------------------------------------
dnl PKG_CONFIG based dependencies
dnl ---------------------------------------------------------------------
PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.40])
GW_CHECK_XCB([xcb-aux xcb-xkb xkbcommon xkbcommon-x11 xcb-ewmh xcb-xinerama xcb-icccm])
GW_CHECK_XCB([xcb-aux xcb-xkb xkbcommon >= 0.5.0 xkbcommon-x11 xcb-ewmh xcb-xinerama xcb-icccm])
PKG_CHECK_MODULES([x11], [x11 x11-xcb])
PKG_CHECK_MODULES([pango], [pango pangocairo])
PKG_CHECK_MODULES([cairo], [cairo cairo-xcb])

View file

@ -240,6 +240,13 @@ void monitor_active ( workarea *mon )
}
fprintf ( stderr, "Failed to find selected monitor.\n" );
}
if ( config.monitor == -3) {
if ( pointer_get ( root, &x, &y ) ) {
mon->x = x;
mon->y = y;
return;
}
}
// Get the current desktop.
unsigned int current_desktop = 0;
if ( config.monitor != -2 && xcb_ewmh_get_current_desktop_reply ( &xcb->ewmh,
@ -290,7 +297,7 @@ void monitor_active ( workarea *mon )
return;
}
}
if ( pointer_get ( xcb->screen->root, &x, &y ) ) {
if ( pointer_get ( root, &x, &y ) ) {
monitor_dimensions ( x, y, mon );
return;
}