ui: Don't use grab ops for grab negotation

Grab operations are now always taken on the backend connection, and
this breaks GTK+'s event handling.

Instead of taking a grab op, just do the handling ourselves. The
GTK+ connection will get an implicit grab, which means pointer /
keyboard events won't be sent to the rest of mutter, which is good.
This commit is contained in:
Jasper St. Pierre 2014-04-24 13:04:15 -04:00
parent c5d4f4a245
commit ebb6847bd1
8 changed files with 86 additions and 393 deletions

View File

@ -659,36 +659,6 @@ meta_core_get_grab_op (Display *xdisplay)
return display->grab_op;
}
Window
meta_core_get_grab_frame (Display *xdisplay)
{
MetaDisplay *display;
display = meta_display_for_x_display (xdisplay);
g_assert (display != NULL);
if (display->grab_op != META_GRAB_OP_NONE &&
display->grab_window &&
display->grab_window->frame)
return display->grab_window->frame->xwindow;
else
return None;
}
int
meta_core_get_grab_button (Display *xdisplay)
{
MetaDisplay *display;
display = meta_display_for_x_display (xdisplay);
if (display->grab_op == META_GRAB_OP_NONE)
return -1;
return display->grab_button;
}
void
meta_core_grab_buttons (Display *xdisplay,
Window frame_xwindow)

View File

@ -182,8 +182,6 @@ gboolean meta_core_begin_grab_op (Display *xdisplay,
void meta_core_end_grab_op (Display *xdisplay,
guint32 timestamp);
MetaGrabOp meta_core_get_grab_op (Display *xdisplay);
Window meta_core_get_grab_frame (Display *xdisplay);
int meta_core_get_grab_button (Display *xdisplay);
void meta_core_grab_buttons (Display *xdisplay,

View File

@ -413,7 +413,6 @@ int meta_resize_gravity_from_grab_op (MetaGrabOp op);
gboolean meta_grab_op_is_moving (MetaGrabOp op);
gboolean meta_grab_op_is_resizing (MetaGrabOp op);
gboolean meta_grab_op_is_moving_or_resizing (MetaGrabOp op);
gboolean meta_grab_op_is_clicking (MetaGrabOp op);
gboolean meta_grab_op_is_mouse (MetaGrabOp op);
gboolean meta_grab_op_is_keyboard (MetaGrabOp op);
gboolean meta_grab_op_should_block_wayland (MetaGrabOp op);

View File

@ -1203,29 +1203,6 @@ meta_grab_op_is_moving_or_resizing (MetaGrabOp op)
meta_grab_op_is_resizing (op));
}
gboolean
meta_grab_op_is_clicking (MetaGrabOp grab_op)
{
switch (grab_op)
{
case META_GRAB_OP_CLICKING_MINIMIZE:
case META_GRAB_OP_CLICKING_MAXIMIZE:
case META_GRAB_OP_CLICKING_UNMAXIMIZE:
case META_GRAB_OP_CLICKING_DELETE:
case META_GRAB_OP_CLICKING_MENU:
case META_GRAB_OP_CLICKING_SHADE:
case META_GRAB_OP_CLICKING_UNSHADE:
case META_GRAB_OP_CLICKING_ABOVE:
case META_GRAB_OP_CLICKING_UNABOVE:
case META_GRAB_OP_CLICKING_STICK:
case META_GRAB_OP_CLICKING_UNSTICK:
return TRUE;
default:
return FALSE;
}
}
/**
* meta_grab_op_should_block_wayland:
* @op: A #MetaGrabOp
@ -1237,18 +1214,14 @@ meta_grab_op_is_clicking (MetaGrabOp grab_op)
gboolean
meta_grab_op_should_block_wayland (MetaGrabOp op)
{
if (op == META_GRAB_OP_NONE)
return FALSE;
if (op == META_GRAB_OP_WAYLAND_POPUP)
return FALSE;
/* Clicking on a frame button needs us to deliver events to the
* frame window, since the button is part of the frame here. */
if (meta_grab_op_is_clicking (op))
return FALSE;
return TRUE;
switch (op)
{
case META_GRAB_OP_WAYLAND_POPUP:
case META_GRAB_OP_NONE:
return FALSE;
default:
return TRUE;
}
}
/**

View File

@ -163,17 +163,6 @@ typedef void (* MetaWindowMenuFunc) (MetaWindowMenu *menu,
* @META_GRAB_OP_KEYBOARD_RESIZING_NE: Resizing NE with keyboard
* @META_GRAB_OP_KEYBOARD_RESIZING_SW: Resizing SW with keyboard
* @META_GRAB_OP_KEYBOARD_RESIZING_NW: Resizing NS with keyboard
* @META_GRAB_OP_CLICKING_MINIMIZE: Clicked minimize button
* @META_GRAB_OP_CLICKING_MAXIMIZE: Clicked maximize button
* @META_GRAB_OP_CLICKING_UNMAXIMIZE: Clicked unmaximize button
* @META_GRAB_OP_CLICKING_DELETE: Clicked delete button
* @META_GRAB_OP_CLICKING_MENU: Clicked on menu
* @META_GRAB_OP_CLICKING_SHADE: Clicked shade button
* @META_GRAB_OP_CLICKING_UNSHADE: Clicked unshade button
* @META_GRAB_OP_CLICKING_ABOVE: Clicked above button
* @META_GRAB_OP_CLICKING_UNABOVE: Clicked unabove button
* @META_GRAB_OP_CLICKING_STICK: Clicked stick button
* @META_GRAB_OP_CLICKING_UNSTICK: Clicked unstick button
* @META_GRAB_OP_COMPOSITOR: Compositor asked for grab
*/
@ -207,19 +196,6 @@ typedef enum
META_GRAB_OP_KEYBOARD_RESIZING_SW,
META_GRAB_OP_KEYBOARD_RESIZING_NW,
/* Frame button ops */
META_GRAB_OP_CLICKING_MINIMIZE,
META_GRAB_OP_CLICKING_MAXIMIZE,
META_GRAB_OP_CLICKING_UNMAXIMIZE,
META_GRAB_OP_CLICKING_DELETE,
META_GRAB_OP_CLICKING_MENU,
META_GRAB_OP_CLICKING_SHADE,
META_GRAB_OP_CLICKING_UNSHADE,
META_GRAB_OP_CLICKING_ABOVE,
META_GRAB_OP_CLICKING_UNABOVE,
META_GRAB_OP_CLICKING_STICK,
META_GRAB_OP_CLICKING_UNSTICK,
/* Special grab op when the compositor asked for a grab */
META_GRAB_OP_COMPOSITOR,

View File

@ -1190,8 +1190,7 @@ meta_frames_button_press_event (GtkWidget *widget,
return meta_frame_double_click_event (frame, event);
}
if (meta_core_get_grab_op (display) !=
META_GRAB_OP_NONE)
if (meta_core_get_grab_op (display) != META_GRAB_OP_NONE)
return FALSE; /* already up to something */
if (event->button == 1 &&
@ -1207,63 +1206,14 @@ meta_frames_button_press_event (GtkWidget *widget,
control == META_FRAME_CONTROL_UNSTICK ||
control == META_FRAME_CONTROL_MENU))
{
MetaGrabOp op = META_GRAB_OP_NONE;
switch (control)
{
case META_FRAME_CONTROL_MINIMIZE:
op = META_GRAB_OP_CLICKING_MINIMIZE;
break;
case META_FRAME_CONTROL_MAXIMIZE:
op = META_GRAB_OP_CLICKING_MAXIMIZE;
break;
case META_FRAME_CONTROL_UNMAXIMIZE:
op = META_GRAB_OP_CLICKING_UNMAXIMIZE;
break;
case META_FRAME_CONTROL_DELETE:
op = META_GRAB_OP_CLICKING_DELETE;
break;
case META_FRAME_CONTROL_MENU:
op = META_GRAB_OP_CLICKING_MENU;
break;
case META_FRAME_CONTROL_SHADE:
op = META_GRAB_OP_CLICKING_SHADE;
break;
case META_FRAME_CONTROL_UNSHADE:
op = META_GRAB_OP_CLICKING_UNSHADE;
break;
case META_FRAME_CONTROL_ABOVE:
op = META_GRAB_OP_CLICKING_ABOVE;
break;
case META_FRAME_CONTROL_UNABOVE:
op = META_GRAB_OP_CLICKING_UNABOVE;
break;
case META_FRAME_CONTROL_STICK:
op = META_GRAB_OP_CLICKING_STICK;
break;
case META_FRAME_CONTROL_UNSTICK:
op = META_GRAB_OP_CLICKING_UNSTICK;
break;
default:
g_assert_not_reached ();
break;
}
meta_core_begin_grab_op (display,
frame->xwindow,
op,
TRUE,
TRUE,
event->button,
0,
event->time,
event->x_root,
event->y_root);
frames->grab_xwindow = frame->xwindow;
frame->grab_button = event->button;
frame->button_state = META_BUTTON_STATE_PRESSED;
frame->prelit_control = control;
redraw_control (frames, frame, control);
if (op == META_GRAB_OP_CLICKING_MENU)
if (control == META_FRAME_CONTROL_MENU)
{
MetaFrameGeometry fgeom;
GdkRectangle *rect;
@ -1380,40 +1330,12 @@ meta_frames_button_press_event (GtkWidget *widget,
return TRUE;
}
void
meta_frames_notify_menu_hide (MetaFrames *frames)
{
Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
if (meta_core_get_grab_op (display) ==
META_GRAB_OP_CLICKING_MENU)
{
Window grab_frame;
grab_frame = meta_core_get_grab_frame (display);
if (grab_frame != None)
{
MetaUIFrame *frame;
frame = meta_frames_lookup_window (frames, grab_frame);
if (frame)
{
redraw_control (frames, frame,
META_FRAME_CONTROL_MENU);
meta_core_end_grab_op (display, CurrentTime);
}
}
}
}
static gboolean
meta_frames_button_release_event (GtkWidget *widget,
GdkEventButton *event)
{
MetaUIFrame *frame;
MetaFrames *frames;
MetaGrabOp op;
Display *display;
frames = META_FRAMES (widget);
@ -1423,103 +1345,48 @@ meta_frames_button_release_event (GtkWidget *widget,
if (frame == NULL)
return FALSE;
op = meta_core_get_grab_op (display);
if (op == META_GRAB_OP_NONE)
return FALSE;
/* We only handle the releases we handled the presses for (things
* involving frame controls). Window ops that don't require a
* frame are handled in the Xlib part of the code, display.c/window.c
*/
if (frame->xwindow == meta_core_get_grab_frame (display) &&
((int) event->button) == meta_core_get_grab_button (display))
if (frame->xwindow == frames->grab_xwindow &&
((int) event->button) == frame->grab_button &&
frame->button_state == META_BUTTON_STATE_PRESSED)
{
MetaFrameControl control;
control = get_control (frames, frame, event->x, event->y);
switch (op)
switch (frame->prelit_control)
{
case META_GRAB_OP_CLICKING_MINIMIZE:
if (control == META_FRAME_CONTROL_MINIMIZE)
meta_core_minimize (display, frame->xwindow);
meta_core_end_grab_op (display, event->time);
case META_FRAME_CONTROL_MINIMIZE:
meta_core_minimize (display, frame->xwindow);
break;
case META_GRAB_OP_CLICKING_MAXIMIZE:
if (control == META_FRAME_CONTROL_MAXIMIZE)
{
/* Focus the window on the maximize */
meta_core_user_focus (display,
frame->xwindow,
event->time);
meta_core_maximize (display, frame->xwindow);
}
meta_core_end_grab_op (display, event->time);
case META_FRAME_CONTROL_MAXIMIZE:
/* Focus the window on the maximize */
meta_core_user_focus (display, frame->xwindow, event->time);
meta_core_maximize (display, frame->xwindow);
break;
case META_GRAB_OP_CLICKING_UNMAXIMIZE:
if (control == META_FRAME_CONTROL_UNMAXIMIZE)
meta_core_unmaximize (display, frame->xwindow);
meta_core_end_grab_op (display, event->time);
case META_FRAME_CONTROL_UNMAXIMIZE:
meta_core_unmaximize (display, frame->xwindow);
break;
case META_GRAB_OP_CLICKING_DELETE:
if (control == META_FRAME_CONTROL_DELETE)
meta_core_delete (display, frame->xwindow, event->time);
meta_core_end_grab_op (display, event->time);
case META_FRAME_CONTROL_DELETE:
meta_core_delete (display, frame->xwindow, event->time);
break;
case META_GRAB_OP_CLICKING_MENU:
meta_core_end_grab_op (display, event->time);
case META_FRAME_CONTROL_SHADE:
meta_core_shade (display, frame->xwindow, event->time);
break;
case META_GRAB_OP_CLICKING_SHADE:
if (control == META_FRAME_CONTROL_SHADE)
meta_core_shade (display, frame->xwindow, event->time);
meta_core_end_grab_op (display, event->time);
case META_FRAME_CONTROL_UNSHADE:
meta_core_unshade (display, frame->xwindow, event->time);
break;
case META_GRAB_OP_CLICKING_UNSHADE:
if (control == META_FRAME_CONTROL_UNSHADE)
meta_core_unshade (display, frame->xwindow, event->time);
meta_core_end_grab_op (display, event->time);
case META_FRAME_CONTROL_ABOVE:
meta_core_make_above (display, frame->xwindow);
break;
case META_GRAB_OP_CLICKING_ABOVE:
if (control == META_FRAME_CONTROL_ABOVE)
meta_core_make_above (display, frame->xwindow);
meta_core_end_grab_op (display, event->time);
case META_FRAME_CONTROL_UNABOVE:
meta_core_unmake_above (display, frame->xwindow);
break;
case META_GRAB_OP_CLICKING_UNABOVE:
if (control == META_FRAME_CONTROL_UNABOVE)
meta_core_unmake_above (display, frame->xwindow);
meta_core_end_grab_op (display, event->time);
case META_FRAME_CONTROL_STICK:
meta_core_stick (display, frame->xwindow);
break;
case META_GRAB_OP_CLICKING_STICK:
if (control == META_FRAME_CONTROL_STICK)
meta_core_stick (display, frame->xwindow);
meta_core_end_grab_op (display, event->time);
case META_FRAME_CONTROL_UNSTICK:
meta_core_unstick (display, frame->xwindow);
break;
case META_GRAB_OP_CLICKING_UNSTICK:
if (control == META_FRAME_CONTROL_UNSTICK)
meta_core_unstick (display, frame->xwindow);
meta_core_end_grab_op (display, event->time);
break;
default:
break;
}
@ -1529,6 +1396,7 @@ meta_frames_button_release_event (GtkWidget *widget,
* prelit so to let the user know that it can now be pressed.
* :)
*/
MetaFrameControl control = get_control (frames, frame, event->x, event->y);
meta_frames_update_prelit_control (frames, frame, control);
}
@ -1543,7 +1411,6 @@ meta_frames_update_prelit_control (MetaFrames *frames,
MetaFrameControl old_control;
MetaCursor cursor;
meta_verbose ("Updating prelit control from %u to %u\n",
frame->prelit_control, control);
@ -1637,6 +1504,7 @@ meta_frames_update_prelit_control (MetaFrames *frames,
/* Save the old control so we can unprelight it */
old_control = frame->prelit_control;
frame->button_state = META_BUTTON_STATE_PRELIGHT;
frame->prelit_control = control;
redraw_control (frames, frame, old_control);
@ -1649,89 +1517,34 @@ meta_frames_motion_notify_event (GtkWidget *widget,
{
MetaUIFrame *frame;
MetaFrames *frames;
MetaGrabOp grab_op;
Display *display;
MetaFrameControl control;
int x, y;
frames = META_FRAMES (widget);
display = GDK_DISPLAY_XDISPLAY (gdk_window_get_display (event->window));
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
if (frame == NULL)
return FALSE;
frames->last_motion_frame = frame;
grab_op = meta_core_get_grab_op (display);
gdk_window_get_device_position (frame->window, event->device,
&x, &y, NULL);
control = get_control (frames, frame, x, y);
switch (grab_op)
if (frame->button_state == META_BUTTON_STATE_PRESSED)
{
case META_GRAB_OP_CLICKING_MENU:
case META_GRAB_OP_CLICKING_DELETE:
case META_GRAB_OP_CLICKING_MINIMIZE:
case META_GRAB_OP_CLICKING_MAXIMIZE:
case META_GRAB_OP_CLICKING_UNMAXIMIZE:
case META_GRAB_OP_CLICKING_SHADE:
case META_GRAB_OP_CLICKING_UNSHADE:
case META_GRAB_OP_CLICKING_ABOVE:
case META_GRAB_OP_CLICKING_UNABOVE:
case META_GRAB_OP_CLICKING_STICK:
case META_GRAB_OP_CLICKING_UNSTICK:
{
MetaFrameControl control;
int x, y;
gdk_window_get_device_position (frame->window, event->device,
&x, &y, NULL);
/* Control is set to none unless it matches
* the current grab
*/
control = get_control (frames, frame, x, y);
if (! ((control == META_FRAME_CONTROL_MENU &&
grab_op == META_GRAB_OP_CLICKING_MENU) ||
(control == META_FRAME_CONTROL_DELETE &&
grab_op == META_GRAB_OP_CLICKING_DELETE) ||
(control == META_FRAME_CONTROL_MINIMIZE &&
grab_op == META_GRAB_OP_CLICKING_MINIMIZE) ||
((control == META_FRAME_CONTROL_MAXIMIZE ||
control == META_FRAME_CONTROL_UNMAXIMIZE) &&
(grab_op == META_GRAB_OP_CLICKING_MAXIMIZE ||
grab_op == META_GRAB_OP_CLICKING_UNMAXIMIZE)) ||
(control == META_FRAME_CONTROL_SHADE &&
grab_op == META_GRAB_OP_CLICKING_SHADE) ||
(control == META_FRAME_CONTROL_UNSHADE &&
grab_op == META_GRAB_OP_CLICKING_UNSHADE) ||
(control == META_FRAME_CONTROL_ABOVE &&
grab_op == META_GRAB_OP_CLICKING_ABOVE) ||
(control == META_FRAME_CONTROL_UNABOVE &&
grab_op == META_GRAB_OP_CLICKING_UNABOVE) ||
(control == META_FRAME_CONTROL_STICK &&
grab_op == META_GRAB_OP_CLICKING_STICK) ||
(control == META_FRAME_CONTROL_UNSTICK &&
grab_op == META_GRAB_OP_CLICKING_UNSTICK)))
control = META_FRAME_CONTROL_NONE;
/* Update prelit control and cursor */
meta_frames_update_prelit_control (frames, frame, control);
}
break;
case META_GRAB_OP_NONE:
{
MetaFrameControl control;
int x, y;
gdk_window_get_device_position (frame->window, event->device,
&x, &y, NULL);
control = get_control (frames, frame, x, y);
/* Update prelit control and cursor */
meta_frames_update_prelit_control (frames, frame, control);
}
break;
default:
break;
/* If the user leaves the frame button, set the state
* back to normal and redraw. */
if (frame->prelit_control != control)
{
frame->button_state = META_BUTTON_STATE_NORMAL;
redraw_control (frames, frame, frame->prelit_control);
}
}
else
{
/* Update prelit control and cursor */
meta_frames_update_prelit_control (frames, frame, control);
}
return TRUE;
@ -1970,10 +1783,9 @@ meta_frames_paint (MetaFrames *frames,
GdkPixbuf *icon;
int w, h;
MetaButtonState button_states[META_BUTTON_TYPE_LAST];
Window grab_frame;
int i;
int button_type = -1;
MetaButtonLayout button_layout;
MetaGrabOp grab_op;
Display *display;
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
@ -1981,84 +1793,49 @@ meta_frames_paint (MetaFrames *frames,
for (i = 0; i < META_BUTTON_TYPE_LAST; i++)
button_states[i] = META_BUTTON_STATE_NORMAL;
grab_frame = meta_core_get_grab_frame (display);
grab_op = meta_core_get_grab_op (display);
if (grab_frame != frame->xwindow)
grab_op = META_GRAB_OP_NONE;
/* Set prelight state */
switch (frame->prelit_control)
{
case META_FRAME_CONTROL_MENU:
if (grab_op == META_GRAB_OP_CLICKING_MENU)
button_states[META_BUTTON_TYPE_MENU] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_MENU] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_MENU;
break;
case META_FRAME_CONTROL_MINIMIZE:
if (grab_op == META_GRAB_OP_CLICKING_MINIMIZE)
button_states[META_BUTTON_TYPE_MINIMIZE] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_MINIMIZE] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_MINIMIZE;
break;
case META_FRAME_CONTROL_MAXIMIZE:
if (grab_op == META_GRAB_OP_CLICKING_MAXIMIZE)
button_states[META_BUTTON_TYPE_MAXIMIZE] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_MAXIMIZE] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_MAXIMIZE;
break;
case META_FRAME_CONTROL_UNMAXIMIZE:
if (grab_op == META_GRAB_OP_CLICKING_UNMAXIMIZE)
button_states[META_BUTTON_TYPE_MAXIMIZE] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_MAXIMIZE] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_MAXIMIZE;
break;
case META_FRAME_CONTROL_SHADE:
if (grab_op == META_GRAB_OP_CLICKING_SHADE)
button_states[META_BUTTON_TYPE_SHADE] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_SHADE] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_SHADE;
break;
case META_FRAME_CONTROL_UNSHADE:
if (grab_op == META_GRAB_OP_CLICKING_UNSHADE)
button_states[META_BUTTON_TYPE_UNSHADE] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_UNSHADE] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_UNSHADE;
break;
case META_FRAME_CONTROL_ABOVE:
if (grab_op == META_GRAB_OP_CLICKING_ABOVE)
button_states[META_BUTTON_TYPE_ABOVE] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_ABOVE] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_ABOVE;
break;
case META_FRAME_CONTROL_UNABOVE:
if (grab_op == META_GRAB_OP_CLICKING_UNABOVE)
button_states[META_BUTTON_TYPE_UNABOVE] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_UNABOVE] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_UNABOVE;
break;
case META_FRAME_CONTROL_STICK:
if (grab_op == META_GRAB_OP_CLICKING_STICK)
button_states[META_BUTTON_TYPE_STICK] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_STICK] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_STICK;
break;
case META_FRAME_CONTROL_UNSTICK:
if (grab_op == META_GRAB_OP_CLICKING_UNSTICK)
button_states[META_BUTTON_TYPE_UNSTICK] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_UNSTICK] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_UNSTICK;
break;
case META_FRAME_CONTROL_DELETE:
if (grab_op == META_GRAB_OP_CLICKING_DELETE)
button_states[META_BUTTON_TYPE_CLOSE] = META_BUTTON_STATE_PRESSED;
else
button_states[META_BUTTON_TYPE_CLOSE] = META_BUTTON_STATE_PRELIGHT;
button_type = META_BUTTON_TYPE_CLOSE;
break;
default:
break;
}
if (button_type > -1)
button_states[button_type] = frame->button_state;
meta_core_get (display, frame->xwindow,
META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_FRAME_TYPE, &type,

View File

@ -82,6 +82,8 @@ struct _MetaUIFrame
/* FIXME get rid of this, it can just be in the MetaFrames struct */
MetaFrameControl prelit_control;
MetaButtonState button_state;
int grab_button;
};
struct _MetaFrames
@ -95,6 +97,8 @@ struct _MetaFrames
GtkStyleContext *normal_style;
GHashTable *style_variants;
Window grab_xwindow;
};
struct _MetaFramesClass
@ -153,8 +157,6 @@ void meta_frames_move_resize_frame (MetaFrames *frames,
void meta_frames_queue_draw (MetaFrames *frames,
Window xwindow);
void meta_frames_notify_menu_hide (MetaFrames *frames);
Window meta_frames_get_moving_frame (MetaFrames *frames);
#endif

View File

@ -133,7 +133,6 @@ menu_closed (GtkMenu *widget,
menu = data;
meta_frames_notify_menu_hide (menu->frames);
(* menu->func) (menu,
GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
menu->client_xwindow,
@ -153,7 +152,6 @@ activate_cb (GtkWidget *menuitem, gpointer data)
md = data;
meta_frames_notify_menu_hide (md->menu->frames);
(* md->menu->func) (md->menu,
GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
md->menu->client_xwindow,