#include "debug.h"
#include "menu.h"
#include "menuframe.h"
+#include "config.h"
#include "screen.h"
#include "client.h"
#include "openbox.h"
}
static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
- ObClient *c, guint state, gpointer data,
- Time time)
+ ObClient *c, guint state, gpointer data)
{
gint x, y;
+ gulong ignore_start;
g_assert(c);
+ if (!config_focus_under_mouse)
+ ignore_start = event_start_ignore_all_enters();
+
switch (e->id) {
case CLIENT_ICONIFY:
/* the client won't be on screen anymore so hide the menu */
g_assert_not_reached();
}
- /* we have to ignore all queued enters because the menu has a grab, and the
- so the cursor isnt considered inside the client's window */
- event_ignore_all_queued_enters();
+ if (!config_focus_under_mouse)
+ event_end_ignore_all_enters(ignore_start);
/* update the menu cuz stuff can have changed */
if (f) {
}
static void layer_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
- ObClient *c, guint state, gpointer data,
- Time time)
+ ObClient *c, guint state, gpointer data)
{
+ gulong ignore_start;
+
g_assert(c);
+ if (!config_focus_under_mouse)
+ ignore_start = event_start_ignore_all_enters();
+
switch (e->id) {
case LAYER_TOP:
client_set_layer(c, 1);
g_assert_not_reached();
}
- /* we have to ignore all queued enters because the menu has a grab, and the
- so the cursor isnt considered inside the client's window */
- event_ignore_all_queued_enters();
+ if (!config_focus_under_mouse)
+ event_end_ignore_all_enters(ignore_start);
/* update the menu cuz stuff can have changed */
if (f) {
}
static void send_to_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
- ObClient *c, guint state, gpointer data,
- Time time)
+ ObClient *c, guint state, gpointer data)
{
g_assert(c);
- client_set_desktop(c, e->id, FALSE);
+ client_set_desktop(c, e->id, FALSE, FALSE);
/* the client won't even be on the screen anymore, so hide the menu */
if (f)
menu_frame_hide_all();
}
static void client_menu_place(ObMenuFrame *frame, gint *x, gint *y,
- gint button, gpointer data)
+ gboolean mouse, gpointer data)
{
gint dx, dy;
- if (button == 0 && frame->client) {
+ if (!mouse && frame->client) {
*x = frame->client->frame->area.x;
/* try below the titlebar */