get the mouse pointer position if it is on another screen too.
let you move/resize from the client menu if the mouse is on another screen
This commit is contained in:
parent
65eb46bd1f
commit
4546925b58
3 changed files with 19 additions and 8 deletions
|
@ -133,18 +133,18 @@ static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
|
||||||
menu_frame_hide_all();
|
menu_frame_hide_all();
|
||||||
f = NULL; /* and don't update */
|
f = NULL; /* and don't update */
|
||||||
|
|
||||||
if (screen_pointer_pos(&x, &y))
|
screen_pointer_pos(&x, &y);
|
||||||
moveresize_start(c, x, y, 0,
|
moveresize_start(c, x, y, 0,
|
||||||
prop_atoms.net_wm_moveresize_move_keyboard);
|
prop_atoms.net_wm_moveresize_move_keyboard);
|
||||||
break;
|
break;
|
||||||
case CLIENT_RESIZE:
|
case CLIENT_RESIZE:
|
||||||
/* this needs to grab the keyboard so hide the menu */
|
/* this needs to grab the keyboard so hide the menu */
|
||||||
menu_frame_hide_all();
|
menu_frame_hide_all();
|
||||||
f = NULL; /* and don't update */
|
f = NULL; /* and don't update */
|
||||||
|
|
||||||
if (screen_pointer_pos(&x, &y))
|
screen_pointer_pos(&x, &y);
|
||||||
moveresize_start(c, x, y, 0,
|
moveresize_start(c, x, y, 0,
|
||||||
prop_atoms.net_wm_moveresize_size_keyboard);
|
prop_atoms.net_wm_moveresize_size_keyboard);
|
||||||
break;
|
break;
|
||||||
case CLIENT_CLOSE:
|
case CLIENT_CLOSE:
|
||||||
client_close(c);
|
client_close(c);
|
||||||
|
|
|
@ -1267,7 +1267,16 @@ gboolean screen_pointer_pos(gint *x, gint *y)
|
||||||
Window w;
|
Window w;
|
||||||
gint i;
|
gint i;
|
||||||
guint u;
|
guint u;
|
||||||
|
gboolean ret;
|
||||||
|
|
||||||
return !!XQueryPointer(ob_display, RootWindow(ob_display, ob_screen),
|
ret = !!XQueryPointer(ob_display, RootWindow(ob_display, ob_screen),
|
||||||
&w, &w, x, y, &i, &i, &u);
|
&w, &w, x, y, &i, &i, &u);
|
||||||
|
if (!ret) {
|
||||||
|
for (i = 0; i < ScreenCount(ob_display); ++i)
|
||||||
|
if (i != ob_screen)
|
||||||
|
if (XQueryPointer(ob_display, RootWindow(ob_display, i),
|
||||||
|
&w, &w, x, y, &i, &i, &u))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,6 +107,8 @@ guint screen_find_monitor(Rect *search);
|
||||||
gotta call it to let it know it should change. */
|
gotta call it to let it know it should change. */
|
||||||
void screen_set_root_cursor();
|
void screen_set_root_cursor();
|
||||||
|
|
||||||
|
/*! Gives back the pointer's position in x and y. Returns TRUE if the pointer
|
||||||
|
is on this screen and FALSE if it is on another screen. */
|
||||||
gboolean screen_pointer_pos(gint *x, gint *y);
|
gboolean screen_pointer_pos(gint *x, gint *y);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue