Patch from Gaute Lindkvist so you can't move the panel or desktop to only

2002-05-26  Havoc Pennington  <hp@pobox.com>

        Patch from Gaute Lindkvist so you can't move the panel or desktop
	to only one workspace.

	* src/keybindings.c (handle_move_to_workspace): don't allow moving
	window to another space if the window is always_sticky

	* src/window.c (recalc_window_features): set the always_sticky
	field for desktop/dock windows.
	(meta_window_show_menu): disable unsticking always sticky windows
	via the menus

	* src/menu.c (meta_window_menu_new): disable workspace items
	if requested
This commit is contained in:
Havoc Pennington 2002-05-26 15:54:38 +00:00 committed by Havoc Pennington
parent e19d4c048a
commit a40a9eccf4
5 changed files with 32 additions and 2 deletions

View File

@ -1,3 +1,19 @@
2002-05-26 Havoc Pennington <hp@pobox.com>
Patch from Gaute Lindkvist so you can't move the panel or desktop
to only one workspace.
* src/keybindings.c (handle_move_to_workspace): don't allow moving
window to another space if the window is always_sticky
* src/window.c (recalc_window_features): set the always_sticky
field for desktop/dock windows.
(meta_window_show_menu): disable unsticking always sticky windows
via the menus
* src/menu.c (meta_window_menu_new): disable workspace items
if requested
2002-05-26 Matthias Warkus <mawarkus@gnome.org> 2002-05-26 Matthias Warkus <mawarkus@gnome.org>
* po/de.po: Added. * po/de.po: Added.

View File

@ -1662,6 +1662,9 @@ handle_move_to_workspace (MetaDisplay *display,
which = GPOINTER_TO_INT (binding->handler->data); which = GPOINTER_TO_INT (binding->handler->data);
if (window == NULL || window->always_sticky)
return;
workspace = NULL; workspace = NULL;
if (which < 0) if (which < 0)
{ {

View File

@ -312,7 +312,8 @@ meta_window_menu_new (MetaFrames *frames,
(active_workspace == i || (active_workspace == i ||
insensitive & META_MENU_OP_WORKSPACES)) insensitive & META_MENU_OP_WORKSPACES))
gtk_widget_set_sensitive (mi, FALSE); gtk_widget_set_sensitive (mi, FALSE);
else if (insensitive & META_MENU_OP_WORKSPACES)
gtk_widget_set_sensitive (mi, FALSE);
md = g_new (MenuData, 1); md = g_new (MenuData, 1);
md->menu = menu; md->menu = menu;

View File

@ -4845,10 +4845,16 @@ recalc_window_features (MetaWindow *window)
window->has_shade_func = TRUE; window->has_shade_func = TRUE;
window->has_fullscreen_func = TRUE; window->has_fullscreen_func = TRUE;
window->always_sticky = FALSE;
/* Semantic category overrides the MWM hints */ /* Semantic category overrides the MWM hints */
if (window->type == META_WINDOW_TOOLBAR) if (window->type == META_WINDOW_TOOLBAR)
window->decorated = FALSE; window->decorated = FALSE;
if (window->type == META_WINDOW_DESKTOP ||
window->type == META_WINDOW_DOCK)
window->always_sticky = TRUE;
if (window->type == META_WINDOW_DESKTOP || if (window->type == META_WINDOW_DESKTOP ||
window->type == META_WINDOW_DOCK || window->type == META_WINDOW_DOCK ||
window->type == META_WINDOW_SPLASHSCREEN) window->type == META_WINDOW_SPLASHSCREEN)
@ -5361,6 +5367,9 @@ meta_window_show_menu (MetaWindow *window,
if (!window->has_resize_func) if (!window->has_resize_func)
insensitive |= META_MENU_OP_RESIZE; insensitive |= META_MENU_OP_RESIZE;
if (window->always_sticky)
insensitive |= META_MENU_OP_UNSTICK | META_MENU_OP_WORKSPACES;
menu = menu =
meta_ui_window_menu_new (window->screen->ui, meta_ui_window_menu_new (window->screen->ui,
window->xwindow, window->xwindow,

View File

@ -139,6 +139,7 @@ struct _MetaWindow
/* Computed features of window */ /* Computed features of window */
guint decorated : 1; guint decorated : 1;
guint always_sticky : 1;
guint has_close_func : 1; guint has_close_func : 1;
guint has_minimize_func : 1; guint has_minimize_func : 1;
guint has_maximize_func : 1; guint has_maximize_func : 1;