diff --git a/ChangeLog b/ChangeLog index d253cb263..1e613630c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-12-27 Bruno Boaventura + + Move "On Top" option in menu. Fix #382962. + + * src/common.h, src/core.c: Remove META_MENU_OP_UNABOVE. + * src/menu.c: remove unabove menu item and put above item + next "Always on Visible Viewport". + * src/window.c: remove handles of META_MENU_OP_UNABOVE. + 2006-12-21 Thomas Thurman * src/compositor.c: Disabled bling for now; added function for diff --git a/src/common.h b/src/common.h index 7a53aa7d8..b58179936 100644 --- a/src/common.h +++ b/src/common.h @@ -64,12 +64,11 @@ typedef enum META_MENU_OP_MOVE = 1 << 9, META_MENU_OP_RESIZE = 1 << 10, META_MENU_OP_ABOVE = 1 << 11, - META_MENU_OP_UNABOVE = 1 << 12, - META_MENU_OP_MOVE_LEFT = 1 << 13, - META_MENU_OP_MOVE_RIGHT = 1 << 14, - META_MENU_OP_MOVE_UP = 1 << 15, - META_MENU_OP_MOVE_DOWN = 1 << 16, - META_MENU_OP_RECOVER = 1 << 17 + META_MENU_OP_MOVE_LEFT = 1 << 12, + META_MENU_OP_MOVE_RIGHT = 1 << 13, + META_MENU_OP_MOVE_UP = 1 << 14, + META_MENU_OP_MOVE_DOWN = 1 << 15, + META_MENU_OP_RECOVER = 1 << 16 } MetaMenuOp; typedef struct _MetaWindowMenu MetaWindowMenu; diff --git a/src/core.c b/src/core.c index be3dc4d78..5480dc4d7 100644 --- a/src/core.c +++ b/src/core.c @@ -531,7 +531,6 @@ meta_core_get_menu_accelerator (MetaMenuOp menu_op, name = META_KEYBINDING_TOGGLE_STICKY; break; case META_MENU_OP_ABOVE: - case META_MENU_OP_UNABOVE: name = META_KEYBINDING_TOGGLE_ABOVE; break; case META_MENU_OP_WORKSPACES: diff --git a/src/menu.c b/src/menu.c index b12bc8e65..7f7dd0624 100644 --- a/src/menu.c +++ b/src/menu.c @@ -75,10 +75,6 @@ static MenuItem menuitems[] = { /* Translators: Translate this string the same way as you do in libwnck! */ { META_MENU_OP_UNSHADE, MENU_ITEM_NORMAL, NULL, FALSE, N_("_Unroll") }, /* Translators: Translate this string the same way as you do in libwnck! */ - { META_MENU_OP_ABOVE, MENU_ITEM_CHECKBOX, NULL, FALSE, N_("On _Top") }, - /* Translators: Translate this string the same way as you do in libwnck! */ - { META_MENU_OP_UNABOVE, MENU_ITEM_CHECKBOX, NULL, TRUE, N_("On _Top") }, - /* Translators: Translate this string the same way as you do in libwnck! */ { META_MENU_OP_MOVE, MENU_ITEM_NORMAL, NULL, FALSE, N_("_Move") }, /* Translators: Translate this string the same way as you do in libwnck! */ { META_MENU_OP_RESIZE, MENU_ITEM_NORMAL, NULL, FALSE, N_("_Resize") }, @@ -89,6 +85,8 @@ static MenuItem menuitems[] = { { META_MENU_OP_DELETE, MENU_ITEM_IMAGE, METACITY_STOCK_DELETE, FALSE, N_("_Close") }, { META_MENU_OP_WORKSPACES, MENU_ITEM_SEPARATOR, NULL, FALSE, NULL }, /* separator */ /* Translators: Translate this string the same way as you do in libwnck! */ + { META_MENU_OP_ABOVE, MENU_ITEM_CHECKBOX, NULL, FALSE, N_("Always on _Top") }, + /* Translators: Translate this string the same way as you do in libwnck! */ { META_MENU_OP_STICK, MENU_ITEM_CHECKBOX, NULL, FALSE, N_("_Always on Visible Workspace") }, /* Translators: Translate this string the same way as you do in libwnck! */ { META_MENU_OP_UNSTICK, MENU_ITEM_CHECKBOX, NULL, FALSE, N_("_Only on This Workspace") }, @@ -346,7 +344,9 @@ meta_window_menu_new (MetaFrames *frames, mi = menu_item_new (&menuitem, -1); - if (menuitem.op == META_MENU_OP_STICK || menuitem.op == META_MENU_OP_UNSTICK) + if ((menuitem.op == META_MENU_OP_STICK) || + (menuitem.op == META_MENU_OP_UNSTICK) || + (menuitem.op == META_MENU_OP_ABOVE)) { Display *xdisplay; MetaDisplay *display; @@ -360,8 +360,12 @@ meta_window_menu_new (MetaFrames *frames, gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi), window->on_all_workspaces); else gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi), !window->on_all_workspaces); + + if (menuitem.op == META_MENU_OP_ABOVE) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi), window->wm_state_above); + } - + if (menuitem.type != MENU_ITEM_SEPARATOR) { meta_core_get_menu_accelerator (menuitems[i].op, -1, diff --git a/src/window.c b/src/window.c index e3e9b42f9..626a875b8 100644 --- a/src/window.c +++ b/src/window.c @@ -6239,11 +6239,10 @@ menu_callback (MetaWindowMenu *menu, break; case META_MENU_OP_ABOVE: - meta_window_make_above (window); - break; - - case META_MENU_OP_UNABOVE: - meta_window_unmake_above (window); + if (window->wm_state_above == FALSE) + meta_window_make_above (window); + else + meta_window_unmake_above (window); break; case META_MENU_OP_MOVE: @@ -6366,13 +6365,10 @@ meta_window_show_menu (MetaWindow *window, ops |= META_MENU_OP_SHADE; #endif - ops |= META_MENU_OP_UNSTICK; - ops |= META_MENU_OP_STICK; + ops |= META_MENU_OP_UNSTICK; + ops |= META_MENU_OP_STICK; - if (window->wm_state_above) - ops |= META_MENU_OP_UNABOVE; - else - ops |= META_MENU_OP_ABOVE; + ops |= META_MENU_OP_ABOVE; if (!window->has_maximize_func) insensitive |= META_MENU_OP_UNMAXIMIZE | META_MENU_OP_MAXIMIZE; @@ -6398,7 +6394,7 @@ meta_window_show_menu (MetaWindow *window, if ((window->type == META_WINDOW_DESKTOP) || (window->type == META_WINDOW_DOCK) || (window->type == META_WINDOW_SPLASHSCREEN)) - insensitive |= META_MENU_OP_ABOVE | META_MENU_OP_UNABOVE; + insensitive |= META_MENU_OP_ABOVE; /* If all operations are disabled, just quit without showing the menu. * This is the case, for example, with META_WINDOW_DESKTOP windows.