X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient_menu.c;h=6fa744c41b8545790886c873251a921e4b4f7b6a;hb=9451205cf172d088948d40999e85ad07c3d430dd;hp=35acd4fd707d37ac2b3388e2ca427d3f4a1aba2d;hpb=65eb46bd1f1f6c97cf1ff9506dd65792303a7ed4;p=chaz%2Fopenbox diff --git a/openbox/client_menu.c b/openbox/client_menu.c index 35acd4fd..6fa744c4 100644 --- a/openbox/client_menu.c +++ b/openbox/client_menu.c @@ -24,6 +24,7 @@ #include "openbox.h" #include "frame.h" #include "moveresize.h" +#include "event.h" #include "prop.h" #include "gettext.h" @@ -90,7 +91,7 @@ static gboolean client_menu_update(ObMenuFrame *frame, gpointer data) *en = c->functions & OB_CLIENT_FUNC_CLOSE; break; case CLIENT_DECORATE: - *en = client_normal(c); + *en = c->functions & OB_CLIENT_FUNC_UNDECORATE; break; default: *en = TRUE; @@ -114,37 +115,41 @@ static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f, menu_frame_hide_all(); f = NULL; /* and don't update */ - client_iconify(c, TRUE, FALSE); + client_iconify(c, TRUE, FALSE, FALSE); break; case CLIENT_RESTORE: client_maximize(c, FALSE, 0); + event_ignore_queued_enters(); break; case CLIENT_MAXIMIZE: client_maximize(c, TRUE, 0); + event_ignore_queued_enters(); break; case CLIENT_SHADE: client_shade(c, !c->shaded); + event_ignore_queued_enters(); break; case CLIENT_DECORATE: client_set_undecorated(c, !c->undecorated); + event_ignore_queued_enters(); break; case CLIENT_MOVE: /* this needs to grab the keyboard so hide the menu */ menu_frame_hide_all(); f = NULL; /* and don't update */ - if (screen_pointer_pos(&x, &y)) - moveresize_start(c, x, y, 0, - prop_atoms.net_wm_moveresize_move_keyboard); + screen_pointer_pos(&x, &y); + moveresize_start(c, x, y, 0, + prop_atoms.net_wm_moveresize_move_keyboard); break; case CLIENT_RESIZE: /* this needs to grab the keyboard so hide the menu */ menu_frame_hide_all(); f = NULL; /* and don't update */ - if (screen_pointer_pos(&x, &y)) - moveresize_start(c, x, y, 0, - prop_atoms.net_wm_moveresize_size_keyboard); + screen_pointer_pos(&x, &y); + moveresize_start(c, x, y, 0, + prop_atoms.net_wm_moveresize_size_keyboard); break; case CLIENT_CLOSE: client_close(c); @@ -176,13 +181,13 @@ static gboolean layer_menu_update(ObMenuFrame *frame, gpointer data) if (e->type == OB_MENU_ENTRY_TYPE_NORMAL) { switch (e->id) { case LAYER_TOP: - *en = !c->above; + *en = !c->above && (c->functions & OB_CLIENT_FUNC_ABOVE); break; case LAYER_NORMAL: *en = c->above || c->below; break; case LAYER_BOTTOM: - *en = !c->below; + *en = !c->below && (c->functions & OB_CLIENT_FUNC_BELOW); break; default: *en = TRUE; @@ -212,6 +217,8 @@ static void layer_menu_execute(ObMenuEntry *e, ObMenuFrame *f, g_assert_not_reached(); } + event_ignore_queued_enters(); + /* update the menu cuz stuff can have changed */ if (f) { layer_menu_update(f, NULL); @@ -391,13 +398,7 @@ void client_menu_startup() e->data.normal.mask_disabled_selected_color = ob_rr_theme->menu_disabled_selected_color; - e = menu_add_normal(menu, CLIENT_SHADE, _("&Roll up/down"), NULL, TRUE); - e->data.normal.mask = ob_rr_theme->shade_mask; - e->data.normal.mask_normal_color = ob_rr_theme->menu_color; - e->data.normal.mask_selected_color = ob_rr_theme->menu_selected_color; - e->data.normal.mask_disabled_color = ob_rr_theme->menu_disabled_color; - e->data.normal.mask_disabled_selected_color = - ob_rr_theme->menu_disabled_selected_color; + menu_add_normal(menu, CLIENT_SHADE, _("&Roll up/down"), NULL, TRUE); menu_add_normal(menu, CLIENT_DECORATE, _("Un/&Decorate"), NULL, TRUE);