summaryrefslogtreecommitdiff
path: root/libwnck
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-05-13 22:29:43 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-05-13 22:29:43 +0000
commitb77aabba24e710276a1edb4d130ede8af1823268 (patch)
tree287821499e5e76d05d90f3b36c969866922b49f5 /libwnck
parent2279bfb42af210e2a6ca750436d3c13d2775510e (diff)
downloadlibwnck-b77aabba24e710276a1edb4d130ede8af1823268.tar.gz
patch from Arvind Samptur <arvind.samptur@wipro.com> to add window
2002-05-13 Havoc Pennington <hp@redhat.com> * libwnck/tasklist.c (wnck_task_popup_menu): patch from Arvind Samptur <arvind.samptur@wipro.com> to add window operation submenus to grouped tasks if you right-click. #79749
Diffstat (limited to 'libwnck')
-rw-r--r--libwnck/tasklist.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index d9e2bf1..80f621e 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -1362,7 +1362,8 @@ wnck_tasklist_activate_task_window (WnckTask *task)
static void
-wnck_task_popup_menu (WnckTask *task)
+wnck_task_popup_menu (WnckTask *task,
+ gboolean action_submenu)
{
GtkWidget *menu;
WnckTask *win_task;
@@ -1411,11 +1412,15 @@ wnck_task_popup_menu (WnckTask *task)
}
gtk_widget_show (menu_item);
-
- g_signal_connect_object (G_OBJECT (menu_item), "activate",
- G_CALLBACK (wnck_task_menu_activated),
- G_OBJECT (win_task),
- 0);
+
+ if (action_submenu)
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item),
+ wnck_create_window_action_menu (win_task->window));
+ else
+ g_signal_connect_object (G_OBJECT (menu_item), "activate",
+ G_CALLBACK (wnck_task_menu_activated),
+ G_OBJECT (win_task),
+ 0);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
@@ -1447,7 +1452,7 @@ wnck_task_button_toggled (GtkButton *button,
if (task->is_application)
{
- wnck_task_popup_menu (task);
+ wnck_task_popup_menu (task, FALSE);
}
else
{
@@ -1680,24 +1685,14 @@ wnck_task_button_press_event (GtkWidget *widget,
gpointer data)
{
WnckTask *task = WNCK_TASK (data);
-
- if (event->button != 1)
- {
- g_signal_stop_emission_by_name (widget,
- "button_press_event");
- }
- else
+
+ if (task->is_application)
{
- if (task->is_application)
- {
- wnck_task_popup_menu (task);
- g_signal_stop_emission_by_name (widget,
- "button_press_event");
- }
+ wnck_task_popup_menu (task,
+ event->button == 3);
+ return TRUE;
}
-
- if (!task->is_application &&
- event->button == 3)
+ else if (event->button == 3)
{
if (task->action_menu)
gtk_widget_destroy (task->action_menu);