Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8899b9da01 | ||
![]() |
76e816a14f | ||
![]() |
2750db2a89 | ||
![]() |
86a913d37a | ||
![]() |
2857fdbdb8 | ||
![]() |
69a7d5ff02 | ||
![]() |
a4f763ac3b | ||
![]() |
f2afa7aa6c | ||
![]() |
a5d2555196 | ||
![]() |
dd5a4ecdf9 | ||
![]() |
43a1d43f2b | ||
![]() |
d6d377a447 | ||
![]() |
ffd95c2ad5 | ||
![]() |
72be89dfb9 | ||
![]() |
2feeb57dee |
14
NEWS
14
NEWS
@@ -1,3 +1,17 @@
|
||||
3.19.1
|
||||
======
|
||||
* wayland: Allow to trigger popups through keyboard/touch [Carlos; #756296]
|
||||
* Fix modifiers-only input source switching on Ubuntu [Alberts; #756543]
|
||||
* Misc. bug fixes [Jonas, Rui, Giovanni, Florian; #756675, #756660, #746420,
|
||||
#756548, #756796, #757101, #757148]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Giovanni Campagna, Carlos Garnacho, Rui Matos,
|
||||
Alberts Muktupāvels, Florian Müllner
|
||||
|
||||
Translations:
|
||||
Daniel Șerbănescu [ro]
|
||||
|
||||
3.18.1
|
||||
======
|
||||
* Misc. crash fixes [Jonas, Rui, Carlos, Owen, Florian; #755096, #754979,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
AC_PREREQ(2.62)
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [18])
|
||||
m4_define([mutter_minor_version], [19])
|
||||
m4_define([mutter_micro_version], [1])
|
||||
|
||||
m4_define([mutter_version],
|
||||
@@ -58,7 +58,7 @@ CANBERRA_GTK_VERSION=0.26
|
||||
CLUTTER_PACKAGE=clutter-1.0
|
||||
|
||||
MUTTER_PC_MODULES="
|
||||
gtk+-3.0 >= 3.9.11
|
||||
gtk+-3.0 >= 3.19.1
|
||||
gio-unix-2.0 >= 2.35.1
|
||||
pango >= 1.2.0
|
||||
cairo >= 1.10.0
|
||||
|
@@ -82,6 +82,7 @@ struct _MetaBackendX11Private
|
||||
gchar *keymap_layouts;
|
||||
gchar *keymap_variants;
|
||||
gchar *keymap_options;
|
||||
int locked_group;
|
||||
};
|
||||
typedef struct _MetaBackendX11Private MetaBackendX11Private;
|
||||
|
||||
@@ -297,15 +298,23 @@ handle_host_xevent (MetaBackend *backend,
|
||||
|
||||
if (event->type == priv->xkb_event_base)
|
||||
{
|
||||
XkbAnyEvent *xkb_ev = (XkbAnyEvent *) event;
|
||||
XkbEvent *xkb_ev = (XkbEvent *) event;
|
||||
|
||||
if (xkb_ev->device == META_VIRTUAL_CORE_KEYBOARD_ID)
|
||||
if (xkb_ev->any.device == META_VIRTUAL_CORE_KEYBOARD_ID)
|
||||
{
|
||||
switch (xkb_ev->xkb_type)
|
||||
switch (xkb_ev->any.xkb_type)
|
||||
{
|
||||
case XkbNewKeyboardNotify:
|
||||
case XkbMapNotify:
|
||||
keymap_changed (backend);
|
||||
break;
|
||||
case XkbStateNotify:
|
||||
if (xkb_ev->state.changed & XkbGroupLockMask)
|
||||
{
|
||||
if (priv->locked_group != xkb_ev->state.locked_group)
|
||||
XkbLockGroup (priv->xdisplay, XkbUseCoreKbd, priv->locked_group);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -776,6 +785,7 @@ meta_backend_x11_lock_layout_group (MetaBackend *backend,
|
||||
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
|
||||
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
|
||||
|
||||
priv->locked_group = idx;
|
||||
XkbLockGroup (priv->xdisplay, XkbUseCoreKbd, idx);
|
||||
}
|
||||
|
||||
|
@@ -637,6 +637,32 @@ output_get_connector_type (MetaMonitorManagerXrandr *manager_xrandr,
|
||||
return META_CONNECTOR_TYPE_Unknown;
|
||||
}
|
||||
|
||||
static void
|
||||
output_get_modes (MetaMonitorManager *manager,
|
||||
MetaOutput *meta_output,
|
||||
XRROutputInfo *output)
|
||||
{
|
||||
guint j, k;
|
||||
guint n_actual_modes;
|
||||
|
||||
meta_output->modes = g_new0 (MetaMonitorMode *, output->nmode);
|
||||
|
||||
n_actual_modes = 0;
|
||||
for (j = 0; j < (guint)output->nmode; j++)
|
||||
{
|
||||
for (k = 0; k < manager->n_modes; k++)
|
||||
{
|
||||
if (output->modes[j] == (XID)manager->modes[k].mode_id)
|
||||
{
|
||||
meta_output->modes[n_actual_modes] = &manager->modes[k];
|
||||
n_actual_modes += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
meta_output->n_modes = n_actual_modes;
|
||||
}
|
||||
|
||||
static char *
|
||||
get_xmode_name (XRRModeInfo *xmode)
|
||||
{
|
||||
@@ -773,6 +799,8 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
||||
MetaOutput *meta_output;
|
||||
|
||||
output = XRRGetOutputInfo (manager_xrandr->xdisplay, resources, resources->outputs[i]);
|
||||
if (!output)
|
||||
continue;
|
||||
|
||||
meta_output = &manager->outputs[n_actual_outputs];
|
||||
|
||||
@@ -780,6 +808,15 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
||||
{
|
||||
GBytes *edid;
|
||||
|
||||
/* Get this first so that if there are no valid modes we
|
||||
can immediately skip to the next output without having
|
||||
to unwind all the assignments below. */
|
||||
output_get_modes (manager, meta_output, output);
|
||||
if (meta_output->n_modes == 0)
|
||||
continue;
|
||||
|
||||
meta_output->preferred_mode = meta_output->modes[0];
|
||||
|
||||
meta_output->winsys_id = resources->outputs[i];
|
||||
meta_output->name = g_strdup (output->name);
|
||||
|
||||
@@ -796,20 +833,6 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
||||
meta_output->connector_type = output_get_connector_type (manager_xrandr, meta_output);
|
||||
|
||||
output_get_tile_info (manager_xrandr, meta_output);
|
||||
meta_output->n_modes = output->nmode;
|
||||
meta_output->modes = g_new0 (MetaMonitorMode *, meta_output->n_modes);
|
||||
for (j = 0; j < meta_output->n_modes; j++)
|
||||
{
|
||||
for (k = 0; k < manager->n_modes; k++)
|
||||
{
|
||||
if (output->modes[j] == (XID)manager->modes[k].mode_id)
|
||||
{
|
||||
meta_output->modes[j] = &manager->modes[k];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
meta_output->preferred_mode = meta_output->modes[0];
|
||||
|
||||
meta_output->n_possible_crtcs = output->ncrtc;
|
||||
meta_output->possible_crtcs = g_new0 (MetaCRTC *, meta_output->n_possible_crtcs);
|
||||
|
@@ -1477,42 +1477,11 @@ button_function_from_string (const char *str)
|
||||
return META_BUTTON_FUNCTION_MAXIMIZE;
|
||||
else if (strcmp (str, "close") == 0)
|
||||
return META_BUTTON_FUNCTION_CLOSE;
|
||||
else if (strcmp (str, "shade") == 0)
|
||||
return META_BUTTON_FUNCTION_SHADE;
|
||||
else if (strcmp (str, "above") == 0)
|
||||
return META_BUTTON_FUNCTION_ABOVE;
|
||||
else if (strcmp (str, "stick") == 0)
|
||||
return META_BUTTON_FUNCTION_STICK;
|
||||
else
|
||||
/* don't know; give up */
|
||||
return META_BUTTON_FUNCTION_LAST;
|
||||
}
|
||||
|
||||
static MetaButtonFunction
|
||||
button_opposite_function (MetaButtonFunction ofwhat)
|
||||
{
|
||||
switch (ofwhat)
|
||||
{
|
||||
case META_BUTTON_FUNCTION_SHADE:
|
||||
return META_BUTTON_FUNCTION_UNSHADE;
|
||||
case META_BUTTON_FUNCTION_UNSHADE:
|
||||
return META_BUTTON_FUNCTION_SHADE;
|
||||
|
||||
case META_BUTTON_FUNCTION_ABOVE:
|
||||
return META_BUTTON_FUNCTION_UNABOVE;
|
||||
case META_BUTTON_FUNCTION_UNABOVE:
|
||||
return META_BUTTON_FUNCTION_ABOVE;
|
||||
|
||||
case META_BUTTON_FUNCTION_STICK:
|
||||
return META_BUTTON_FUNCTION_UNSTICK;
|
||||
case META_BUTTON_FUNCTION_UNSTICK:
|
||||
return META_BUTTON_FUNCTION_STICK;
|
||||
|
||||
default:
|
||||
return META_BUTTON_FUNCTION_LAST;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
button_layout_handler (GVariant *value,
|
||||
gpointer *result,
|
||||
@@ -1556,12 +1525,6 @@ button_layout_handler (GVariant *value,
|
||||
if (i > 0 && strcmp("spacer", buttons[b]) == 0)
|
||||
{
|
||||
new_layout.left_buttons_has_spacer[i-1] = TRUE;
|
||||
f = button_opposite_function (f);
|
||||
|
||||
if (f != META_BUTTON_FUNCTION_LAST)
|
||||
{
|
||||
new_layout.left_buttons_has_spacer[i-2] = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1570,11 +1533,6 @@ button_layout_handler (GVariant *value,
|
||||
new_layout.left_buttons[i] = f;
|
||||
used[f] = TRUE;
|
||||
++i;
|
||||
|
||||
f = button_opposite_function (f);
|
||||
|
||||
if (f != META_BUTTON_FUNCTION_LAST)
|
||||
new_layout.left_buttons[i++] = f;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1618,11 +1576,6 @@ button_layout_handler (GVariant *value,
|
||||
if (i > 0 && strcmp("spacer", buttons[b]) == 0)
|
||||
{
|
||||
new_layout.right_buttons_has_spacer[i-1] = TRUE;
|
||||
f = button_opposite_function (f);
|
||||
if (f != META_BUTTON_FUNCTION_LAST)
|
||||
{
|
||||
new_layout.right_buttons_has_spacer[i-2] = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1631,12 +1584,6 @@ button_layout_handler (GVariant *value,
|
||||
new_layout.right_buttons[i] = f;
|
||||
used[f] = TRUE;
|
||||
++i;
|
||||
|
||||
f = button_opposite_function (f);
|
||||
|
||||
if (f != META_BUTTON_FUNCTION_LAST)
|
||||
new_layout.right_buttons[i++] = f;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -3534,10 +3534,7 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
|
||||
{
|
||||
const MetaMonitorInfo *old, *new;
|
||||
|
||||
if (window->type == META_WINDOW_DESKTOP)
|
||||
return;
|
||||
|
||||
if (window->override_redirect)
|
||||
if (window->override_redirect || window->type == META_WINDOW_DESKTOP)
|
||||
{
|
||||
meta_window_update_monitor (window, FALSE);
|
||||
return;
|
||||
|
@@ -372,12 +372,6 @@ typedef enum
|
||||
* @META_BUTTON_FUNCTION_MINIMIZE: Minimize
|
||||
* @META_BUTTON_FUNCTION_MAXIMIZE: Maximize
|
||||
* @META_BUTTON_FUNCTION_CLOSE: Close
|
||||
* @META_BUTTON_FUNCTION_SHADE: Shade
|
||||
* @META_BUTTON_FUNCTION_ABOVE: Above
|
||||
* @META_BUTTON_FUNCTION_STICK: Stick
|
||||
* @META_BUTTON_FUNCTION_UNSHADE: Unshade
|
||||
* @META_BUTTON_FUNCTION_UNABOVE: Unabove
|
||||
* @META_BUTTON_FUNCTION_UNSTICK: Unstick
|
||||
* @META_BUTTON_FUNCTION_LAST: Marks the end of the #MetaButtonFunction enumeration
|
||||
*
|
||||
* Function a window button can have. Note, you can't add stuff here
|
||||
@@ -390,12 +384,6 @@ typedef enum
|
||||
META_BUTTON_FUNCTION_MINIMIZE,
|
||||
META_BUTTON_FUNCTION_MAXIMIZE,
|
||||
META_BUTTON_FUNCTION_CLOSE,
|
||||
META_BUTTON_FUNCTION_SHADE,
|
||||
META_BUTTON_FUNCTION_ABOVE,
|
||||
META_BUTTON_FUNCTION_STICK,
|
||||
META_BUTTON_FUNCTION_UNSHADE,
|
||||
META_BUTTON_FUNCTION_UNABOVE,
|
||||
META_BUTTON_FUNCTION_UNSTICK,
|
||||
META_BUTTON_FUNCTION_APPMENU,
|
||||
META_BUTTON_FUNCTION_LAST
|
||||
} MetaButtonFunction;
|
||||
@@ -405,10 +393,10 @@ typedef enum
|
||||
/* Keep array size in sync with MAX_BUTTONS_PER_CORNER */
|
||||
/**
|
||||
* MetaButtonLayout:
|
||||
* @left_buttons: (array fixed-size=11):
|
||||
* @right_buttons: (array fixed-size=11):
|
||||
* @left_buttons_has_spacer: (array fixed-size=11):
|
||||
* @right_buttons_has_spacer: (array fixed-size=11):
|
||||
* @left_buttons: (array fixed-size=5):
|
||||
* @right_buttons: (array fixed-size=5):
|
||||
* @left_buttons_has_spacer: (array fixed-size=5):
|
||||
* @right_buttons_has_spacer: (array fixed-size=5):
|
||||
*/
|
||||
typedef struct _MetaButtonLayout MetaButtonLayout;
|
||||
struct _MetaButtonLayout
|
||||
|
108
src/ui/frames.c
108
src/ui/frames.c
@@ -970,12 +970,6 @@ meta_frame_left_click_event (MetaUIFrame *frame,
|
||||
case META_FRAME_CONTROL_UNMAXIMIZE:
|
||||
case META_FRAME_CONTROL_MINIMIZE:
|
||||
case META_FRAME_CONTROL_DELETE:
|
||||
case META_FRAME_CONTROL_SHADE:
|
||||
case META_FRAME_CONTROL_UNSHADE:
|
||||
case META_FRAME_CONTROL_ABOVE:
|
||||
case META_FRAME_CONTROL_UNABOVE:
|
||||
case META_FRAME_CONTROL_STICK:
|
||||
case META_FRAME_CONTROL_UNSTICK:
|
||||
case META_FRAME_CONTROL_MENU:
|
||||
case META_FRAME_CONTROL_APPMENU:
|
||||
frame->grab_button = event->button;
|
||||
@@ -1154,24 +1148,6 @@ handle_button_release_event (MetaUIFrame *frame,
|
||||
case META_FRAME_CONTROL_DELETE:
|
||||
meta_window_delete (frame->meta_window, event->time);
|
||||
break;
|
||||
case META_FRAME_CONTROL_SHADE:
|
||||
meta_window_shade (frame->meta_window, event->time);
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNSHADE:
|
||||
meta_window_unshade (frame->meta_window, event->time);
|
||||
break;
|
||||
case META_FRAME_CONTROL_ABOVE:
|
||||
meta_window_make_above (frame->meta_window);
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNABOVE:
|
||||
meta_window_unmake_above (frame->meta_window);
|
||||
break;
|
||||
case META_FRAME_CONTROL_STICK:
|
||||
meta_window_stick (frame->meta_window);
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNSTICK:
|
||||
meta_window_unstick (frame->meta_window);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1220,18 +1196,6 @@ meta_ui_frame_update_prelit_control (MetaUIFrame *frame,
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNMAXIMIZE:
|
||||
break;
|
||||
case META_FRAME_CONTROL_SHADE:
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNSHADE:
|
||||
break;
|
||||
case META_FRAME_CONTROL_ABOVE:
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNABOVE:
|
||||
break;
|
||||
case META_FRAME_CONTROL_STICK:
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNSTICK:
|
||||
break;
|
||||
case META_FRAME_CONTROL_RESIZE_SE:
|
||||
cursor = META_CURSOR_SE_RESIZE;
|
||||
break;
|
||||
@@ -1270,12 +1234,6 @@ meta_ui_frame_update_prelit_control (MetaUIFrame *frame,
|
||||
case META_FRAME_CONTROL_MINIMIZE:
|
||||
case META_FRAME_CONTROL_MAXIMIZE:
|
||||
case META_FRAME_CONTROL_DELETE:
|
||||
case META_FRAME_CONTROL_SHADE:
|
||||
case META_FRAME_CONTROL_UNSHADE:
|
||||
case META_FRAME_CONTROL_ABOVE:
|
||||
case META_FRAME_CONTROL_UNABOVE:
|
||||
case META_FRAME_CONTROL_STICK:
|
||||
case META_FRAME_CONTROL_UNSTICK:
|
||||
case META_FRAME_CONTROL_UNMAXIMIZE:
|
||||
/* leave control set */
|
||||
break;
|
||||
@@ -1487,24 +1445,6 @@ meta_ui_frame_paint (MetaUIFrame *frame,
|
||||
case META_FRAME_CONTROL_UNMAXIMIZE:
|
||||
button_type = META_BUTTON_TYPE_MAXIMIZE;
|
||||
break;
|
||||
case META_FRAME_CONTROL_SHADE:
|
||||
button_type = META_BUTTON_TYPE_SHADE;
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNSHADE:
|
||||
button_type = META_BUTTON_TYPE_UNSHADE;
|
||||
break;
|
||||
case META_FRAME_CONTROL_ABOVE:
|
||||
button_type = META_BUTTON_TYPE_ABOVE;
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNABOVE:
|
||||
button_type = META_BUTTON_TYPE_UNABOVE;
|
||||
break;
|
||||
case META_FRAME_CONTROL_STICK:
|
||||
button_type = META_BUTTON_TYPE_STICK;
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNSTICK:
|
||||
button_type = META_BUTTON_TYPE_UNSTICK;
|
||||
break;
|
||||
case META_FRAME_CONTROL_DELETE:
|
||||
button_type = META_BUTTON_TYPE_CLOSE;
|
||||
break;
|
||||
@@ -1624,24 +1564,6 @@ control_rect (MetaFrameControl control,
|
||||
case META_FRAME_CONTROL_UNMAXIMIZE:
|
||||
rect = &fgeom->max_rect.visible;
|
||||
break;
|
||||
case META_FRAME_CONTROL_SHADE:
|
||||
rect = &fgeom->shade_rect.visible;
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNSHADE:
|
||||
rect = &fgeom->unshade_rect.visible;
|
||||
break;
|
||||
case META_FRAME_CONTROL_ABOVE:
|
||||
rect = &fgeom->above_rect.visible;
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNABOVE:
|
||||
rect = &fgeom->unabove_rect.visible;
|
||||
break;
|
||||
case META_FRAME_CONTROL_STICK:
|
||||
rect = &fgeom->stick_rect.visible;
|
||||
break;
|
||||
case META_FRAME_CONTROL_UNSTICK:
|
||||
rect = &fgeom->unstick_rect.visible;
|
||||
break;
|
||||
case META_FRAME_CONTROL_RESIZE_SE:
|
||||
break;
|
||||
case META_FRAME_CONTROL_RESIZE_S:
|
||||
@@ -1726,36 +1648,6 @@ get_control (MetaUIFrame *frame, int root_x, int root_y)
|
||||
return META_FRAME_CONTROL_MAXIMIZE;
|
||||
}
|
||||
|
||||
if (POINT_IN_RECT (x, y, fgeom.shade_rect.clickable))
|
||||
{
|
||||
return META_FRAME_CONTROL_SHADE;
|
||||
}
|
||||
|
||||
if (POINT_IN_RECT (x, y, fgeom.unshade_rect.clickable))
|
||||
{
|
||||
return META_FRAME_CONTROL_UNSHADE;
|
||||
}
|
||||
|
||||
if (POINT_IN_RECT (x, y, fgeom.above_rect.clickable))
|
||||
{
|
||||
return META_FRAME_CONTROL_ABOVE;
|
||||
}
|
||||
|
||||
if (POINT_IN_RECT (x, y, fgeom.unabove_rect.clickable))
|
||||
{
|
||||
return META_FRAME_CONTROL_UNABOVE;
|
||||
}
|
||||
|
||||
if (POINT_IN_RECT (x, y, fgeom.stick_rect.clickable))
|
||||
{
|
||||
return META_FRAME_CONTROL_STICK;
|
||||
}
|
||||
|
||||
if (POINT_IN_RECT (x, y, fgeom.unstick_rect.clickable))
|
||||
{
|
||||
return META_FRAME_CONTROL_UNSTICK;
|
||||
}
|
||||
|
||||
/* South resize always has priority over north resize,
|
||||
* in case of overlap.
|
||||
*/
|
||||
|
@@ -39,12 +39,6 @@ typedef enum
|
||||
META_FRAME_CONTROL_MINIMIZE,
|
||||
META_FRAME_CONTROL_MAXIMIZE,
|
||||
META_FRAME_CONTROL_UNMAXIMIZE,
|
||||
META_FRAME_CONTROL_SHADE,
|
||||
META_FRAME_CONTROL_UNSHADE,
|
||||
META_FRAME_CONTROL_ABOVE,
|
||||
META_FRAME_CONTROL_UNABOVE,
|
||||
META_FRAME_CONTROL_STICK,
|
||||
META_FRAME_CONTROL_UNSTICK,
|
||||
META_FRAME_CONTROL_RESIZE_SE,
|
||||
META_FRAME_CONTROL_RESIZE_S,
|
||||
META_FRAME_CONTROL_RESIZE_SW,
|
||||
|
@@ -115,7 +115,7 @@ struct _MetaFrameGeometry
|
||||
|
||||
/* used for a memset hack */
|
||||
#define ADDRESS_OF_BUTTON_RECTS(fgeom) (((char*)(fgeom)) + G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
|
||||
#define LENGTH_OF_BUTTON_RECTS (G_STRUCT_OFFSET (MetaFrameGeometry, unstick_rect) + sizeof (MetaButtonSpace) - G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
|
||||
#define LENGTH_OF_BUTTON_RECTS (G_STRUCT_OFFSET (MetaFrameGeometry, appmenu_rect) + sizeof (MetaButtonSpace) - G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
|
||||
|
||||
/* The button rects (if changed adjust memset hack) */
|
||||
MetaButtonSpace close_rect;
|
||||
@@ -123,12 +123,6 @@ struct _MetaFrameGeometry
|
||||
MetaButtonSpace min_rect;
|
||||
MetaButtonSpace menu_rect;
|
||||
MetaButtonSpace appmenu_rect;
|
||||
MetaButtonSpace shade_rect;
|
||||
MetaButtonSpace above_rect;
|
||||
MetaButtonSpace stick_rect;
|
||||
MetaButtonSpace unshade_rect;
|
||||
MetaButtonSpace unabove_rect;
|
||||
MetaButtonSpace unstick_rect;
|
||||
/* End of button rects (if changed adjust memset hack) */
|
||||
|
||||
/* Saved button layout */
|
||||
@@ -158,12 +152,6 @@ typedef enum
|
||||
META_BUTTON_TYPE_MINIMIZE,
|
||||
META_BUTTON_TYPE_MENU,
|
||||
META_BUTTON_TYPE_APPMENU,
|
||||
META_BUTTON_TYPE_SHADE,
|
||||
META_BUTTON_TYPE_ABOVE,
|
||||
META_BUTTON_TYPE_STICK,
|
||||
META_BUTTON_TYPE_UNSHADE,
|
||||
META_BUTTON_TYPE_UNABOVE,
|
||||
META_BUTTON_TYPE_UNSTICK,
|
||||
META_BUTTON_TYPE_LAST
|
||||
} MetaButtonType;
|
||||
|
||||
|
@@ -177,17 +177,6 @@ rect_for_function (MetaFrameGeometry *fgeom,
|
||||
return &fgeom->close_rect;
|
||||
else
|
||||
return NULL;
|
||||
case META_BUTTON_FUNCTION_STICK:
|
||||
case META_BUTTON_FUNCTION_SHADE:
|
||||
case META_BUTTON_FUNCTION_ABOVE:
|
||||
case META_BUTTON_FUNCTION_UNSTICK:
|
||||
case META_BUTTON_FUNCTION_UNSHADE:
|
||||
case META_BUTTON_FUNCTION_UNABOVE:
|
||||
/* Fringe buttons that used to be supported by theme versions >v1;
|
||||
* if we want to support them again, we need to return the
|
||||
* correspondings rects here
|
||||
*/
|
||||
return NULL;
|
||||
|
||||
case META_BUTTON_FUNCTION_LAST:
|
||||
return NULL;
|
||||
@@ -457,22 +446,10 @@ meta_frame_layout_calc_geometry (MetaFrameLayout *layout,
|
||||
}
|
||||
|
||||
/* Otherwise we need to shave out a button. Shave
|
||||
* above, stick, shade, min, max, close, then menu (menu is most useful);
|
||||
* min, max, close, then menu (menu is most useful);
|
||||
* prefer the default button locations.
|
||||
*/
|
||||
if (strip_button (left_func_rects, &n_left, &fgeom->above_rect))
|
||||
continue;
|
||||
else if (strip_button (right_func_rects, &n_right, &fgeom->above_rect))
|
||||
continue;
|
||||
else if (strip_button (left_func_rects, &n_left, &fgeom->stick_rect))
|
||||
continue;
|
||||
else if (strip_button (right_func_rects, &n_right, &fgeom->stick_rect))
|
||||
continue;
|
||||
else if (strip_button (left_func_rects, &n_left, &fgeom->shade_rect))
|
||||
continue;
|
||||
else if (strip_button (right_func_rects, &n_right, &fgeom->shade_rect))
|
||||
continue;
|
||||
else if (strip_button (left_func_rects, &n_left, &fgeom->min_rect))
|
||||
if (strip_button (left_func_rects, &n_left, &fgeom->min_rect))
|
||||
continue;
|
||||
else if (strip_button (right_func_rects, &n_right, &fgeom->min_rect))
|
||||
continue;
|
||||
@@ -643,30 +620,6 @@ get_button_rect (MetaButtonType type,
|
||||
*rect = fgeom->close_rect.visible;
|
||||
break;
|
||||
|
||||
case META_BUTTON_TYPE_SHADE:
|
||||
*rect = fgeom->shade_rect.visible;
|
||||
break;
|
||||
|
||||
case META_BUTTON_TYPE_UNSHADE:
|
||||
*rect = fgeom->unshade_rect.visible;
|
||||
break;
|
||||
|
||||
case META_BUTTON_TYPE_ABOVE:
|
||||
*rect = fgeom->above_rect.visible;
|
||||
break;
|
||||
|
||||
case META_BUTTON_TYPE_UNABOVE:
|
||||
*rect = fgeom->unabove_rect.visible;
|
||||
break;
|
||||
|
||||
case META_BUTTON_TYPE_STICK:
|
||||
*rect = fgeom->stick_rect.visible;
|
||||
break;
|
||||
|
||||
case META_BUTTON_TYPE_UNSTICK:
|
||||
*rect = fgeom->unstick_rect.visible;
|
||||
break;
|
||||
|
||||
case META_BUTTON_TYPE_MAXIMIZE:
|
||||
*rect = fgeom->max_rect.visible;
|
||||
break;
|
||||
@@ -890,6 +843,7 @@ meta_frame_layout_draw_with_style (MetaFrameLayout *layout,
|
||||
cairo_restore (cr);
|
||||
if (button_class)
|
||||
gtk_style_context_remove_class (style, button_class);
|
||||
gtk_style_context_set_state (style, state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -975,6 +929,7 @@ static GtkStyleContext *
|
||||
create_style_context (GType widget_type,
|
||||
GtkStyleContext *parent_style,
|
||||
GtkCssProvider *provider,
|
||||
const char *object_name,
|
||||
const char *first_class,
|
||||
...)
|
||||
{
|
||||
@@ -994,6 +949,9 @@ create_style_context (GType widget_type,
|
||||
|
||||
gtk_widget_path_append_type (path, widget_type);
|
||||
|
||||
if (object_name)
|
||||
gtk_widget_path_iter_set_object_name (path, -1, object_name);
|
||||
|
||||
va_start (ap, first_class);
|
||||
for (name = first_class; name; name = va_arg (ap, const char *))
|
||||
gtk_widget_path_iter_add_class (path, -1, name);
|
||||
@@ -1033,6 +991,7 @@ meta_theme_create_style_info (GdkScreen *screen,
|
||||
create_style_context (META_TYPE_FRAMES,
|
||||
NULL,
|
||||
provider,
|
||||
"decoration",
|
||||
GTK_STYLE_CLASS_BACKGROUND,
|
||||
"window-frame",
|
||||
"ssd",
|
||||
@@ -1041,6 +1000,7 @@ meta_theme_create_style_info (GdkScreen *screen,
|
||||
create_style_context (GTK_TYPE_HEADER_BAR,
|
||||
style_info->styles[META_STYLE_ELEMENT_FRAME],
|
||||
provider,
|
||||
NULL,
|
||||
GTK_STYLE_CLASS_TITLEBAR,
|
||||
GTK_STYLE_CLASS_HORIZONTAL,
|
||||
"default-decoration",
|
||||
@@ -1050,12 +1010,14 @@ meta_theme_create_style_info (GdkScreen *screen,
|
||||
create_style_context (GTK_TYPE_LABEL,
|
||||
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
|
||||
provider,
|
||||
NULL,
|
||||
GTK_STYLE_CLASS_TITLE,
|
||||
NULL);
|
||||
style_info->styles[META_STYLE_ELEMENT_BUTTON] =
|
||||
create_style_context (GTK_TYPE_BUTTON,
|
||||
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
|
||||
provider,
|
||||
NULL,
|
||||
GTK_STYLE_CLASS_BUTTON,
|
||||
"titlebutton",
|
||||
NULL);
|
||||
@@ -1063,6 +1025,7 @@ meta_theme_create_style_info (GdkScreen *screen,
|
||||
create_style_context (GTK_TYPE_IMAGE,
|
||||
style_info->styles[META_STYLE_ELEMENT_BUTTON],
|
||||
provider,
|
||||
NULL,
|
||||
NULL);
|
||||
return style_info;
|
||||
}
|
||||
|
@@ -251,11 +251,12 @@ notify_key (MetaWaylandKeyboard *keyboard,
|
||||
{
|
||||
struct wl_client *client = wl_resource_get_client (keyboard->focus_surface->resource);
|
||||
struct wl_display *display = wl_client_get_display (client);
|
||||
uint32_t serial = wl_display_next_serial (display);
|
||||
|
||||
keyboard->key_serial = wl_display_next_serial (display);
|
||||
|
||||
wl_resource_for_each (resource, l)
|
||||
{
|
||||
wl_keyboard_send_key (resource, serial, time, key, state);
|
||||
wl_keyboard_send_key (resource, keyboard->key_serial, time, key, state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,3 +673,10 @@ meta_wayland_keyboard_create_new_resource (MetaWaylandKeyboard *keyboard,
|
||||
wl_list_insert (&keyboard->resource_list, wl_resource_get_link (cr));
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_keyboard_can_popup (MetaWaylandKeyboard *keyboard,
|
||||
uint32_t serial)
|
||||
{
|
||||
return keyboard->key_serial == serial;
|
||||
}
|
||||
|
@@ -68,6 +68,7 @@ struct _MetaWaylandKeyboard
|
||||
MetaWaylandSurface *focus_surface;
|
||||
struct wl_listener focus_surface_listener;
|
||||
uint32_t focus_serial;
|
||||
uint32_t key_serial;
|
||||
|
||||
MetaWaylandXkbInfo xkb_info;
|
||||
enum xkb_state_component mods_changed;
|
||||
@@ -100,4 +101,7 @@ void meta_wayland_keyboard_create_new_resource (MetaWaylandKeyboard *keyboard,
|
||||
struct wl_resource *seat_resource,
|
||||
uint32_t id);
|
||||
|
||||
gboolean meta_wayland_keyboard_can_popup (MetaWaylandKeyboard *keyboard,
|
||||
uint32_t serial);
|
||||
|
||||
#endif /* META_WAYLAND_KEYBOARD_H */
|
||||
|
@@ -405,3 +405,12 @@ meta_wayland_seat_get_grab_info (MetaWaylandSeat *seat,
|
||||
|
||||
return sequence || can_grab_surface;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_seat_can_popup (MetaWaylandSeat *seat,
|
||||
uint32_t serial)
|
||||
{
|
||||
return (meta_wayland_pointer_can_popup (&seat->pointer, serial) ||
|
||||
meta_wayland_keyboard_can_popup (&seat->keyboard, serial) ||
|
||||
meta_wayland_touch_can_popup (&seat->touch, serial));
|
||||
}
|
||||
|
@@ -64,5 +64,7 @@ gboolean meta_wayland_seat_get_grab_info (MetaWaylandSeat *seat,
|
||||
uint32_t serial,
|
||||
gfloat *x,
|
||||
gfloat *y);
|
||||
gboolean meta_wayland_seat_can_popup (MetaWaylandSeat *seat,
|
||||
uint32_t serial);
|
||||
|
||||
#endif /* META_WAYLAND_SEAT_H */
|
||||
|
@@ -933,22 +933,26 @@ set_surface_is_on_output (MetaWaylandSurface *surface,
|
||||
MetaWaylandOutput *wayland_output,
|
||||
gboolean is_on_output)
|
||||
{
|
||||
gboolean was_on_output = g_hash_table_contains (surface->outputs,
|
||||
wayland_output);
|
||||
gpointer orig_id;
|
||||
gboolean was_on_output = g_hash_table_lookup_extended (surface->outputs_to_destroy_notify_id,
|
||||
wayland_output,
|
||||
NULL, &orig_id);
|
||||
|
||||
if (!was_on_output && is_on_output)
|
||||
{
|
||||
g_signal_connect (wayland_output, "output-destroyed",
|
||||
G_CALLBACK (surface_handle_output_destroy),
|
||||
surface);
|
||||
g_hash_table_add (surface->outputs, wayland_output);
|
||||
gulong id;
|
||||
|
||||
id = g_signal_connect (wayland_output, "output-destroyed",
|
||||
G_CALLBACK (surface_handle_output_destroy),
|
||||
surface);
|
||||
g_hash_table_insert (surface->outputs_to_destroy_notify_id, wayland_output,
|
||||
GSIZE_TO_POINTER ((gsize)id));
|
||||
surface_entered_output (surface, wayland_output);
|
||||
}
|
||||
else if (was_on_output && !is_on_output)
|
||||
{
|
||||
g_hash_table_remove (surface->outputs, wayland_output);
|
||||
g_signal_handlers_disconnect_by_func (
|
||||
wayland_output, (gpointer)surface_handle_output_destroy, surface);
|
||||
g_hash_table_remove (surface->outputs_to_destroy_notify_id, wayland_output);
|
||||
g_signal_handler_disconnect (wayland_output, (gulong) GPOINTER_TO_SIZE (orig_id));
|
||||
surface_left_output (surface, wayland_output);
|
||||
}
|
||||
}
|
||||
@@ -986,6 +990,12 @@ update_surface_output_state (gpointer key, gpointer value, gpointer user_data)
|
||||
set_surface_is_on_output (surface, wayland_output, is_on_output);
|
||||
}
|
||||
|
||||
static void
|
||||
surface_output_disconnect_signal (gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
g_signal_handler_disconnect (key, (gulong) GPOINTER_TO_SIZE (value));
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_surface_update_outputs (MetaWaylandSurface *surface)
|
||||
{
|
||||
@@ -1036,7 +1046,8 @@ wl_surface_destructor (struct wl_resource *resource)
|
||||
|
||||
meta_wayland_compositor_destroy_frame_callbacks (compositor, surface);
|
||||
|
||||
g_hash_table_unref (surface->outputs);
|
||||
g_hash_table_foreach (surface->outputs_to_destroy_notify_id, surface_output_disconnect_signal, surface);
|
||||
g_hash_table_unref (surface->outputs_to_destroy_notify_id);
|
||||
|
||||
wl_list_for_each_safe (cb, next, &surface->pending_frame_callback_list, link)
|
||||
wl_resource_destroy (cb->resource);
|
||||
@@ -1081,7 +1092,7 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
|
||||
|
||||
sync_drag_dest_funcs (surface);
|
||||
|
||||
surface->outputs = g_hash_table_new (NULL, NULL);
|
||||
surface->outputs_to_destroy_notify_id = g_hash_table_new (NULL, NULL);
|
||||
|
||||
pending_state_init (&surface->pending);
|
||||
return surface;
|
||||
@@ -1515,15 +1526,15 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
|
||||
surface,
|
||||
xdg_popup_destructor);
|
||||
|
||||
if (!meta_wayland_pointer_can_popup (&seat->pointer, serial))
|
||||
surface->xdg_popup = popup_resource;
|
||||
surface->xdg_shell_resource = resource;
|
||||
|
||||
if (!meta_wayland_seat_can_popup (seat, serial))
|
||||
{
|
||||
xdg_popup_send_popup_done (popup_resource);
|
||||
return;
|
||||
}
|
||||
|
||||
surface->xdg_popup = popup_resource;
|
||||
surface->xdg_shell_resource = resource;
|
||||
|
||||
surface->popup.parent = parent_surf;
|
||||
surface->popup.parent_destroy_listener.notify = handle_popup_parent_destroyed;
|
||||
wl_resource_add_destroy_listener (parent_surf->resource,
|
||||
@@ -1739,7 +1750,7 @@ wl_shell_surface_set_popup (struct wl_client *client,
|
||||
|
||||
wl_shell_surface_set_state (surface, SURFACE_STATE_TOPLEVEL);
|
||||
|
||||
if (!meta_wayland_pointer_can_popup (&seat->pointer, serial))
|
||||
if (!meta_wayland_seat_can_popup (seat, serial))
|
||||
{
|
||||
wl_shell_surface_send_popup_done (resource);
|
||||
return;
|
||||
|
@@ -147,7 +147,7 @@ struct _MetaWaylandSurface
|
||||
int scale;
|
||||
int32_t offset_x, offset_y;
|
||||
GList *subsurfaces;
|
||||
GHashTable *outputs;
|
||||
GHashTable *outputs_to_destroy_notify_id;
|
||||
|
||||
/* List of pending frame callbacks that needs to stay queued longer than one
|
||||
* commit sequence, such as when it has not yet been assigned a role.
|
||||
|
@@ -575,6 +575,26 @@ meta_wayland_touch_create_new_resource (MetaWaylandTouch *touch,
|
||||
wl_list_insert (&touch->resource_list, wl_resource_get_link (cr));
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_touch_can_popup (MetaWaylandTouch *touch,
|
||||
uint32_t serial)
|
||||
{
|
||||
MetaWaylandTouchInfo *touch_info;
|
||||
GHashTableIter iter;
|
||||
|
||||
if (!touch->touches)
|
||||
return FALSE;
|
||||
|
||||
g_hash_table_iter_init (&iter, touch->touches);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer*) &touch_info))
|
||||
{
|
||||
if (touch_info->slot_serial == serial)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ClutterEventSequence *
|
||||
meta_wayland_touch_find_grab_sequence (MetaWaylandTouch *touch,
|
||||
MetaWaylandSurface *surface,
|
||||
|
@@ -70,4 +70,7 @@ gboolean meta_wayland_touch_get_press_coords (MetaWaylandTouch *touch,
|
||||
gfloat *x,
|
||||
gfloat *y);
|
||||
|
||||
gboolean meta_wayland_touch_can_popup (MetaWaylandTouch *touch,
|
||||
uint32_t serial);
|
||||
|
||||
#endif /* META_WAYLAND_TOUCH_H */
|
||||
|
@@ -182,6 +182,8 @@ argbdata_to_surface (gulong *argb_data, int w, int h)
|
||||
}
|
||||
}
|
||||
|
||||
cairo_surface_mark_dirty (surface);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
|
@@ -863,7 +863,7 @@ meta_window_x11_grab_op_began (MetaWindow *window,
|
||||
if (window->sync_request_counter != None)
|
||||
meta_window_x11_create_sync_request_alarm (window);
|
||||
|
||||
if (window->size_hints.width_inc > 1 || window->size_hints.height_inc > 1)
|
||||
if (window->size_hints.width_inc > 2 || window->size_hints.height_inc > 2)
|
||||
{
|
||||
priv->showing_resize_popup = TRUE;
|
||||
meta_window_refresh_resize_popup (window);
|
||||
|
Reference in New Issue
Block a user