~ubuntu-branches/ubuntu/oneiric/gnome-panel/oneiric

« back to all changes in this revision

Viewing changes to gnome-panel/panel-action-protocol.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-05-30 11:04:49 UTC
  • mfrom: (1.3.4 upstream)
  • mto: This revision was merged to the branch mainline in revision 204.
  • Revision ID: james.westby@ubuntu.com-20110530110449-ut1tc5t61rpvf9e3
Tags: upstream-3.0.2
ImportĀ upstreamĀ versionĀ 3.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
        }
62
62
 
63
63
        info = panel_applet_get_by_type (PANEL_OBJECT_MENU, screen);
64
 
        if (info && !panel_menu_button_get_use_menu_path (PANEL_MENU_BUTTON (info->widget))) {
 
64
        if (info && panel_menu_button_is_main_menu (PANEL_MENU_BUTTON (info->widget))) {
65
65
                panel_menu_button_popup_menu (PANEL_MENU_BUTTON (info->widget),
66
66
                                              1, activate_time);
67
67
                return;
98
98
{
99
99
        GdkWindow *window;
100
100
        GdkScreen *screen;
 
101
        GdkDisplay *display;
101
102
        XEvent    *xevent = (XEvent *) gdk_xevent;
102
103
 
103
104
        if (xevent->type != ClientMessage)
106
107
        if (xevent->xclient.message_type != atom_gnome_panel_action)
107
108
                return GDK_FILTER_CONTINUE;
108
109
 
109
 
        window = gdk_window_lookup (xevent->xclient.window);
 
110
        screen = gdk_event_get_screen (event);
 
111
        display = gdk_screen_get_display (screen);
 
112
        window = gdk_x11_window_lookup_for_display (display, xevent->xclient.window);
110
113
        if (!window)
111
114
                return GDK_FILTER_CONTINUE;
112
115
 
113
 
        screen = gdk_drawable_get_screen (window);
 
116
        if (window != gdk_screen_get_root_window (screen))
 
117
                return GDK_FILTER_CONTINUE;
114
118
 
115
119
        if (xevent->xclient.data.l [0] == atom_gnome_panel_action_main_menu)
116
120
                panel_action_protocol_main_menu (screen, xevent->xclient.data.l [1]);
128
132
panel_action_protocol_init (void)
129
133
{
130
134
        GdkDisplay *display;
131
 
        GdkAtom     gdk_atom_gnome_panel_action;
132
135
 
133
136
        display = gdk_display_get_default ();
134
137
 
135
 
        gdk_atom_gnome_panel_action =
136
 
                gdk_atom_intern_static_string ("_GNOME_PANEL_ACTION");
137
 
 
138
138
        atom_gnome_panel_action =
139
139
                XInternAtom (GDK_DISPLAY_XDISPLAY (display),
140
140
                             "_GNOME_PANEL_ACTION",
152
152
                             "_GNOME_PANEL_ACTION_KILL_DIALOG",
153
153
                             FALSE);
154
154
 
155
 
        gdk_display_add_client_message_filter (
156
 
                display, gdk_atom_gnome_panel_action,
157
 
                panel_action_protocol_filter, NULL);
 
155
        /* We'll filter event sent on non-root windows later */
 
156
        gdk_window_add_filter (NULL, panel_action_protocol_filter, NULL);
158
157
}