Compare commits

...

30 Commits

Author SHA1 Message Date
88e466f8a8 compositor: add hooks for fullscreen and unfullscreen animations
https://bugzilla.gnome.org/show_bug.cgi?id=707248
2015-10-12 15:40:24 -04:00
377ecdb864 compositor: pass correct parameter to meta_window_actor_size_change()
We were always passing the parameter for a maximize animation.
2015-10-12 15:39:51 -04:00
d7f544f42e META_DEBUG_STACK: Fix message about the dumped window order
A change in the code made the windows list bottom-to-top instead
of top-to-bottom, but the message printed out still said
"Top to bottom."
2015-10-12 09:52:25 -04:00
1ab8b854df Improve debug logging of Wayland windows
Displaying all Wayland windows with the XID of 0x0 makes it hard
to figure out what is going on ... use the recently-added
window->stamp to show Wayland windows as W1/W2/W3...
2015-10-12 09:52:25 -04:00
ae7aabd5de Protect against stray calls to meta_display_end_grab_op()
If end_grab_op() is called when there's a "compositor grab"
rather than a grab op is in effect, silently return.

https://bugzilla.gnome.org/show_bug.cgi?id=745785
2015-10-12 09:50:48 -04:00
b975676c5d window-actor: Draw shadows around some CSD windows
Some windows, like Chromium and Steam, are technically CSD in that they
don't want a system titlebar and draw their own, but we should still
provide them with a shadow.
2015-10-07 12:09:30 -07:00
86d8c3954f theme: Stop hiding titlebar buttons in dialogs
As design patterns have evolved, dialogs that use CSD do use titlebar
buttons, so it's time to re-enable them for SSD as well.

https://bugzilla.gnome.org/show_bug.cgi?id=641630
2015-10-07 16:09:17 +02:00
54557f062e xprops: Fix reading Window and XSyncCounter properties
Both Window and XSyncCounter are XIDs which on 64 bit X clients are 8
bytes wide. But the values on the wire are 32 bit so, for these types,
we always copy 4 bytes into results->prop. As such copying them out
with a cast such as *(Window *) means that we are actually reading 8
bytes which depending on whether the higher addressed 4 bytes are zero
means that sometimes this works while others it gives us a bogus
value.

https://bugzilla.gnome.org/show_bug.cgi?id=756074
2015-10-06 22:33:42 +02:00
130807a308 wayland: Don't pre-multiply root cursor sizes with primary monitor scale
We cannot use the XSETTINGS value for cursor theme size because
gnome-settings-daemon already multiplies it by the primary monitor's
scale.

https://bugzilla.gnome.org/show_bug.cgi?id=755099
2015-10-04 14:17:14 +08:00
e84f694668 wayland: Don't scale XWayland pointer cursor sprites
We don't have any way of knowing what the intended size of a XWayland
cursor is supposed to be, so lets do what we do with regular XWayland
surfaces and don't scale them. The result is that cursor sprites of
HiDPI aware X11 clients will show correctly, but non-aware clients may
have tiny cursor sprites.

https://bugzilla.gnome.org/show_bug.cgi?id=755099
2015-10-04 14:17:14 +08:00
b18542f2b6 wayland: Avoid resending new data offers on intra-client focus changes
Each keyboard focus change ends up calling the MetaWaylandDataDevice
counterpart, we don't need though to notify the current selection
again. In order to fix this, keep track of the current client, and
only emit the relevant signals when the focus switches to another
client.

The situations where wl_data_device.selection were emitted during
focus changes between surfaces of the same client was inocuous most
of the times, although it's prone to inducing confusing behavior
on context menu clipboard actions, as the closing menu triggers a
focus change, which triggers a whole new wl_data_offer being created
and given on wl_data_device.selection, at a time where there's already
ongoing requests on the previous data offer.

https://bugzilla.gnome.org/show_bug.cgi?id=754357
2015-10-02 12:21:17 +02:00
da0aac665f xwayland: Protect against crash on x11->wayland transfer cancellation
If the transfer is cancelled, the X11SelectionData will be cleared from
the MetaSelectionBridge, although x11_data_write_cb() was invariably
expecting it to be non-NULL.

If the write was cancelled, all the actions done in x11_data_write_cb()
are moot, so just return early. If there's other errors happening
(eg. "connection closed" if the target client happens to crash), we
should still attempt at clearing the data anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=754357
2015-10-02 12:21:17 +02:00
8b0b0cf028 MetaWaylandSurface: Don't assume a toplevel always have a MetaWindow
When committing a toplevel surface we might no longer have a MetaWindow
associated with it. The reason may vary but some are: a popup was
dismissed, the client attached and committed a NULL buffer to a
wl_surface with the wl_shell_surface role, the client committed a
buffer to a wl_surface which previously had an toplevel window role
which extension object was destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=755490
2015-09-29 09:09:57 +08:00
6f64d6b0aa wayland: Check the drag focus before processing XDND dest-side messages
If the drag dest surface suddenly disappears, we may find ourselves
processing an XdndPosition message that was sent before the X11 drag
source had an opportunity to find out.

In that case mutter does know, so double check before processing the
messages.
2015-09-28 16:22:54 +02:00
ebeca983c7 wayland: Improve transformation of the UTF8_STRING atom to mimetype
We try to translate the atom with its corresponding mimetype both back
and forth, which actually breaks if the X11 client chose to announce the
mimetype atom. To do the translation properly, keep track on whether the
source announced the UTF8_STRING atom, and reply back with this only if
that happened.
2015-09-28 16:22:43 +02:00
cf88675807 wayland: Fix weak ref tracking on data sources
We may get a NULL one here, and we're wrongly attempting to remove
the old weak ref from the new data source object.
2015-09-28 16:22:32 +02:00
405f1ce3d0 wayland: Avoid use of struct data after destruction
data_device_end_drag_grab() will destroy the MetaWaylandDragGrab struct,
so we definitely must not use it after destruction.
2015-09-28 16:22:18 +02:00
6190ae3873 window: Remove invalid (transfer) annnotations
This tripped a new g-i warning; see
https://bugzilla.gnome.org/show_bug.cgi?id=752047
2015-09-27 16:42:01 -04:00
69c267b142 xwayland: Fix windows disappearing on reparenting
If the wayland surface isn't available yet when we process the
WL_SURFACE_ID ClientMessage, we schedule a later function to try the
association again after we get a chance to process wayland requests.

This works fine except on cases where the MetaWindow already had a
previous surface attached (i.e. when the xwindow is reparented) since
we only break the existing association on the later function which
means that when processing the old surface's destruction we destroy
the MetaWindow and cancel the pending later function leaving us
without a MetaWindow and an invisible surface.

Fix this by detaching the old surface as soon as possible so that the
MetaWindow survives.

https://bugzilla.gnome.org/show_bug.cgi?id=743339
2015-09-25 19:09:48 +02:00
9abc071283 backend-x11: Fallback to a default keymap if getting it from X fails
This shouldn't fail but apparently sometimes it does and in that case
having a possibly wrong idea of the keymap is still better than
crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=754979
2015-09-25 19:09:48 +02:00
a9df4bb81a wayland: Scale saved rect changing monitor scale
The saved rect is used to restore a saved window size. We need to
update this when the window is moved to a monitor with different scale,
so that if we unmaximize a window which was moved to a different
monitor while maximized (for example when unplugged) will restore to
the correct size.

https://bugzilla.gnome.org/show_bug.cgi?id=755097
2015-09-24 11:39:37 +08:00
bc9e63d3db wayland: Scale unconstrained rect changing monitor scale
When a window is moved across monitors with different scales, its
rectangle is scaled accordingly. We also need to scale the
unconstrained_rect rectangle, so that moving a window via
meta_window_move_resize() which uses the unconstrained_rect.

https://bugzilla.gnome.org/show_bug.cgi?id=755097
2015-09-24 11:39:37 +08:00
5b5ceede2b wayland: Fix variable declaration
Storage class always goes first.
2015-09-24 03:08:23 +02:00
4e63c95c02 testboxes: Don't avoid parameter list 2015-09-24 03:08:23 +02:00
67d3a7a2d7 meta-monitor-manager: Remove bogus condition from check
An unsigned number is never smaller than 0, so we don't have to
check for it.
2015-09-24 03:08:23 +02:00
bc00f118f3 Avoid shadowing existing variables 2015-09-24 03:08:22 +02:00
5801b5518f Annotate functions to improve compiler diagnostics 2015-09-24 03:01:51 +02:00
25a796afc6 Fix constness warnings 2015-09-24 03:01:51 +02:00
27b37407d0 Don't duplicate declarations from G_DEFINE_TYPE 2015-09-24 03:01:51 +02:00
e23e697043 wayland: Fix output destroyed callback vfunc type
It is not a callback on a parameter signal, and get no GParamSpec passed
to it. This fixes a crash when a surface is on a destroyed output.

https://bugzilla.gnome.org/show_bug.cgi?id=755096
2015-09-24 08:08:41 +08:00
40 changed files with 318 additions and 215 deletions

View File

@ -54,8 +54,6 @@ struct _MetaCursorRendererClass
XcursorImage *xc_image);
};
GType meta_cursor_renderer_get_type (void) G_GNUC_CONST;
MetaCursorRenderer * meta_cursor_renderer_new (void);
void meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,

View File

@ -60,8 +60,6 @@ struct _MetaCursorSprite
gboolean theme_dirty;
};
GType meta_cursor_sprite_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaCursorSprite, meta_cursor_sprite, G_TYPE_OBJECT)
static const char *

View File

@ -523,15 +523,13 @@ update_trackball_scroll_button (MetaInputSettings *input_settings,
}
else if (!device)
{
MetaInputSettingsPrivate *priv;
const GSList *devices;
priv = meta_input_settings_get_instance_private (input_settings);
devices = clutter_device_manager_peek_devices (priv->device_manager);
while (devices)
{
ClutterInputDevice *device = devices->data;
device = devices->data;
if (device_is_trackball (device))
input_settings_class->set_scroll_button (input_settings, device, button);

View File

@ -1846,7 +1846,7 @@ crtc_assignment_assign (CrtcAssignment *assign,
}
else
{
MetaCRTCInfo *info = g_slice_new0 (MetaCRTCInfo);
info = g_slice_new0 (MetaCRTCInfo);
info->crtc = crtc;
info->mode = mode;

View File

@ -197,7 +197,7 @@ meta_monitor_manager_dummy_apply_config (MetaMonitorManager *manager,
{
MetaMonitorMode *mode;
MetaOutput *output;
int i, n_outputs;
unsigned int j;
int width, height;
mode = crtc_info->mode;
@ -223,10 +223,9 @@ meta_monitor_manager_dummy_apply_config (MetaMonitorManager *manager,
screen_width = MAX (screen_width, crtc_info->x + width);
screen_height = MAX (screen_height, crtc_info->y + height);
n_outputs = crtc_info->outputs->len;
for (i = 0; i < n_outputs; i++)
for (j = 0; j < crtc_info->outputs->len; j++)
{
output = ((MetaOutput**)crtc_info->outputs->pdata)[i];
output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
output->is_dirty = TRUE;
output->crtc = crtc;

View File

@ -884,8 +884,7 @@ meta_monitor_manager_handle_apply_configuration (MetaDBusDisplayConfig *skeleto
crtc_info->y = 0;
}
if (transform < META_MONITOR_TRANSFORM_NORMAL ||
transform > META_MONITOR_TRANSFORM_FLIPPED_270 ||
if (transform > META_MONITOR_TRANSFORM_FLIPPED_270 ||
((crtc->all_transforms & (1 << transform)) == 0))
{
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,

View File

@ -112,12 +112,12 @@ get_seat_proxy (GCancellable *cancellable)
static void
session_unpause (void)
{
ClutterBackend *backend;
ClutterBackend *clutter_backend;
CoglContext *cogl_context;
CoglDisplay *cogl_display;
backend = clutter_get_default_backend ();
cogl_context = clutter_backend_get_cogl_context (backend);
clutter_backend = clutter_get_default_backend ();
cogl_context = clutter_backend_get_cogl_context (clutter_backend);
cogl_display = cogl_context_get_display (cogl_context);
cogl_kms_display_queue_modes_reset (cogl_display);

View File

@ -441,6 +441,7 @@ meta_backend_x11_post_init (MetaBackend *backend)
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
int major, minor;
gboolean has_xi = FALSE;
priv->xdisplay = clutter_x11_get_default_display ();
@ -450,27 +451,23 @@ meta_backend_x11_post_init (MetaBackend *backend)
!XSyncInitialize (priv->xdisplay, &major, &minor))
meta_fatal ("Could not initialize XSync");
{
int major = 2, minor = 3;
gboolean has_xi = FALSE;
if (XQueryExtension (priv->xdisplay,
"XInputExtension",
&priv->xinput_opcode,
&priv->xinput_error_base,
&priv->xinput_event_base))
{
major = 2; minor = 3;
if (XIQueryVersion (priv->xdisplay, &major, &minor) == Success)
{
int version = (major * 10) + minor;
if (version >= 22)
has_xi = TRUE;
}
}
if (XQueryExtension (priv->xdisplay,
"XInputExtension",
&priv->xinput_opcode,
&priv->xinput_error_base,
&priv->xinput_event_base))
{
if (XIQueryVersion (priv->xdisplay, &major, &minor) == Success)
{
int version = (major * 10) + minor;
if (version >= 22)
has_xi = TRUE;
}
}
if (!has_xi)
meta_fatal ("X server doesn't have the XInput extension, version 2.2 or newer\n");
}
if (!has_xi)
meta_fatal ("X server doesn't have the XInput extension, version 2.2 or newer\n");
/* We only take the passive touch grab if we are a X11 compositor */
if (priv->mode == META_BACKEND_X11_MODE_COMPOSITOR)
@ -763,6 +760,9 @@ meta_backend_x11_get_keymap (MetaBackend *backend)
priv->xcb,
xkb_x11_get_core_keyboard_device_id (priv->xcb),
XKB_KEYMAP_COMPILE_NO_FLAGS);
if (priv->keymap == NULL)
priv->keymap = xkb_keymap_new_from_names (context, NULL, XKB_KEYMAP_COMPILE_NO_FLAGS);
xkb_context_unref (context);
}
@ -795,8 +795,6 @@ meta_backend_x11_update_screen_size (MetaBackend *backend,
}
else
{
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
Window xwin = meta_backend_x11_get_xwindow (x11);
XResizeWindow (priv->xdisplay, xwin, width, height);
}

View File

@ -1133,17 +1133,16 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
if (crtc_info->mode != NULL)
{
MetaMonitorMode *mode;
g_autofree XID *outputs = NULL;
unsigned int j, n_outputs;
int width, height;
g_autofree XID *output_ids = NULL;
unsigned int j, n_output_ids;
Status ok;
mode = crtc_info->mode;
n_outputs = crtc_info->outputs->len;
outputs = g_new (XID, n_outputs);
n_output_ids = crtc_info->outputs->len;
output_ids = g_new (XID, n_output_ids);
for (j = 0; j < n_outputs; j++)
for (j = 0; j < n_output_ids; j++)
{
MetaOutput *output;
@ -1152,7 +1151,7 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
output->is_dirty = TRUE;
output->crtc = crtc;
outputs[j] = output->winsys_id;
output_ids[j] = output->winsys_id;
}
ok = XRRSetCrtcConfig (manager_xrandr->xdisplay,
@ -1162,7 +1161,7 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
crtc_info->x, crtc_info->y,
(XID)mode->mode_id,
meta_monitor_transform_to_xrandr (crtc_info->transform),
outputs, n_outputs);
output_ids, n_output_ids);
if (ok != Success)
{

View File

@ -33,8 +33,6 @@ struct _MetaCursorRendererX11Nested
MetaCursorRenderer parent;
};
GType meta_cursor_renderer_x11_nested_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaCursorRendererX11Nested, meta_cursor_renderer_x11_nested,
META_TYPE_CURSOR_RENDERER);

View File

@ -779,7 +779,7 @@ meta_compositor_size_change_window (MetaCompositor *compositor,
MetaRectangle *old_buffer_rect)
{
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
meta_window_actor_size_change (window_actor, META_SIZE_CHANGE_MAXIMIZE, old_frame_rect, old_buffer_rect);
meta_window_actor_size_change (window_actor, which_change, old_frame_rect, old_buffer_rect);
}
void

View File

@ -832,21 +832,23 @@ meta_window_actor_has_shadow (MetaWindowActor *self)
return TRUE;
/*
* Do not add shadows to non-opaque windows; eventually we should generate
* a shadow from the input shape for such windows.
* Do not add shadows to non-opaque (ARGB32) windows, as we can't easily
* generate shadows for them.
*/
if (is_non_opaque (self))
return FALSE;
/*
* Add shadows to override redirect windows on X11 unless the toolkit
* indicates that it is handling shadows itself (e.g., Gtk menus).
* If a window specifies that it has custom frame extents, that likely
* means that it is drawing a shadow itself. Don't draw our own.
*/
if (priv->window->override_redirect &&
!priv->window->has_custom_frame_extents)
return TRUE;
if (priv->window->has_custom_frame_extents)
return FALSE;
return FALSE;
/*
* Generate shadows for all other windows.
*/
return TRUE;
}
/**

View File

@ -547,7 +547,7 @@ meta_display_open (void)
guint32 timestamp;
/* A list of all atom names, so that we can intern them in one go. */
char *atom_names[] = {
const char *atom_names[] = {
#define item(x) #x,
#include <x11/atomnames.h>
#undef item
@ -605,14 +605,13 @@ meta_display_open (void)
meta_prefs_add_listener (prefs_changed_callback, display);
meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
XInternAtoms (display->xdisplay, atom_names, G_N_ELEMENTS (atom_names),
XInternAtoms (display->xdisplay, (char **)atom_names, G_N_ELEMENTS (atom_names),
False, atoms);
{
int i = 0;
i = 0;
#define item(x) display->atom_##x = atoms[i++];
#include <x11/atomnames.h>
#undef item
}
display->prop_hooks = NULL;
meta_display_init_window_prop_hooks (display);
@ -1964,9 +1963,12 @@ meta_display_end_grab_op (MetaDisplay *display,
meta_topic (META_DEBUG_WINDOW_OPS,
"Ending grab op %u at time %u\n", grab_op, timestamp);
if (display->event_route == META_EVENT_ROUTE_NORMAL)
if (display->event_route == META_EVENT_ROUTE_NORMAL ||
display->event_route == META_EVENT_ROUTE_COMPOSITOR_GRAB)
return;
g_assert (grab_window != NULL);
g_signal_emit (display, display_signals[GRAB_OP_END], 0,
display->screen, grab_window, grab_op);

View File

@ -206,8 +206,8 @@ meta_display_handle_event (MetaDisplay *display,
if (meta_is_wayland_compositor () && event->type == CLUTTER_MOTION)
{
MetaCursorTracker *tracker = meta_cursor_tracker_get_for_screen (NULL);
meta_cursor_tracker_update_position (tracker, event->motion.x, event->motion.y);
meta_cursor_tracker_update_position (meta_cursor_tracker_get_for_screen (NULL),
event->motion.x, event->motion.y);
display->monitor_cache_invalidated = TRUE;
}

View File

@ -188,7 +188,7 @@ reload_modmap (MetaKeyBindingManager *keys)
/* Modifiers to find. */
struct {
char *name;
const char *name;
xkb_mod_mask_t *mask_p;
} mods[] = {
{ "ScrollLock", &scroll_lock_mask },

View File

@ -44,7 +44,7 @@ print_version (const gchar *option_name,
exit (0);
}
static gchar *plugin = "default";
static const char *plugin = "default";
GOptionEntry mutter_options[] = {
{

View File

@ -96,6 +96,10 @@ static gboolean bell_is_audible = TRUE;
static gboolean gnome_accessibility = FALSE;
static gboolean gnome_animations = TRUE;
static char *cursor_theme = NULL;
/* cursor_size will, when running as an X11 compositing window manager, be the
* actual cursor size, multiplied with the global window scaling factor. On
* Wayland, it will be the actual cursor size retrieved from gsettings.
*/
static int cursor_size = 24;
static int draggable_border_width = 10;
static int drag_threshold;
@ -123,6 +127,9 @@ static gboolean update_binding (MetaKeyPref *binding,
static gboolean update_key_binding (const char *key,
gchar **strokes);
static void wayland_settings_changed (GSettings *settings,
gchar *key,
gpointer data);
static void settings_changed (GSettings *settings,
gchar *key,
gpointer data);
@ -134,9 +141,10 @@ static void shell_shows_app_menu_changed (GtkSettings *settings,
GParamSpec *pspec,
gpointer data);
static void update_cursor_size (GtkSettings *settings,
GParamSpec *pspec,
gpointer data);
static void update_cursor_size_from_gtk (GtkSettings *settings,
GParamSpec *pspec,
gpointer data);
static void update_cursor_size (void);
static void queue_changed (MetaPreference pref);
@ -161,8 +169,8 @@ typedef struct
typedef struct
{
char *key;
char *schema;
const char *key;
const char *schema;
MetaPreference pref;
} MetaBasePreference;
@ -963,14 +971,18 @@ meta_prefs_init (void)
G_CALLBACK (settings_changed), NULL);
g_signal_connect (settings, "changed::" KEY_GNOME_CURSOR_THEME,
G_CALLBACK (settings_changed), NULL);
if (meta_is_wayland_compositor ())
g_signal_connect (settings, "changed::cursor-size",
G_CALLBACK (wayland_settings_changed), NULL);
g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_INTERFACE), settings);
g_signal_connect (gtk_settings_get_default (),
"notify::gtk-shell-shows-app-menu",
G_CALLBACK (shell_shows_app_menu_changed), NULL);
g_signal_connect (gtk_settings_get_default (), "notify::gtk-cursor-theme-size",
G_CALLBACK (update_cursor_size), NULL);
if (!meta_is_wayland_compositor ())
g_signal_connect (gtk_settings_get_default (), "notify::gtk-cursor-theme-size",
G_CALLBACK (update_cursor_size_from_gtk), NULL);
settings = g_settings_new (SCHEMA_INPUT_SOURCES);
g_signal_connect (settings, "changed::" KEY_XKB_OPTIONS,
@ -992,7 +1004,7 @@ meta_prefs_init (void)
handle_preference_init_string_array ();
handle_preference_init_int ();
update_cursor_size (gtk_settings_get_default (), NULL, NULL);
update_cursor_size ();
shell_shows_app_menu_changed (gtk_settings_get_default (), NULL, NULL);
init_bindings ();
@ -1133,6 +1145,20 @@ meta_prefs_override_preference_schema (const char *key, const char *schema)
/****************************************************************************/
static void
wayland_settings_changed (GSettings *settings,
gchar *key,
gpointer data)
{
GVariant *value = g_settings_get_value (settings, key);
const GVariantType *type = g_variant_get_type (value);
g_return_if_fail (g_variant_type_equal (type, G_VARIANT_TYPE_INT32));
g_return_if_fail (g_str_equal (key, "cursor-size"));
update_cursor_size ();
}
static void
settings_changed (GSettings *settings,
gchar *key,
@ -1216,9 +1242,29 @@ shell_shows_app_menu_changed (GtkSettings *settings,
}
static void
update_cursor_size (GtkSettings *settings,
GParamSpec *pspec,
gpointer data)
update_cursor_size (void)
{
if (meta_is_wayland_compositor ())
{
/* When running as a Wayland compositor, since we size of the cursor
* depends on what output it is on, we cannot use the GTK+
* "gtk-cursor-theme-size" setting because it has already been multiplied
* by the primary monitor scale. So, instead get the non-premultiplied
* cursor size value directly from gsettings instead.
*/
cursor_size =
g_settings_get_int (SETTINGS (SCHEMA_INTERFACE), "cursor-size");
}
else
{
update_cursor_size_from_gtk (gtk_settings_get_default (), NULL, NULL);
}
}
static void
update_cursor_size_from_gtk (GtkSettings *settings,
GParamSpec *pspec,
gpointer data)
{
GdkScreen *screen = gdk_screen_get_default ();
GValue value = G_VALUE_INIT;

View File

@ -2100,7 +2100,7 @@ meta_screen_queue_workarea_recalc (MetaScreen *screen)
#ifdef WITH_VERBOSE_MODE
static char *
static const char *
meta_screen_corner_to_string (MetaScreenCorner corner)
{
switch (corner)

View File

@ -1055,7 +1055,7 @@ stack_sync_to_xserver (MetaStack *stack)
all_root_children_stacked = g_array_new (FALSE, FALSE, sizeof (guint64));
x11_hidden_stack_ids = g_array_new (FALSE, FALSE, sizeof (guint64));
meta_topic (META_DEBUG_STACK, "Top to bottom: ");
meta_topic (META_DEBUG_STACK, "Bottom to top: ");
meta_push_no_msg_prefix ();
for (tmp = g_list_last(stack->sorted); tmp != NULL; tmp = tmp->prev)
@ -1088,11 +1088,7 @@ stack_sync_to_xserver (MetaStack *stack)
if (w->hidden)
{
if (w->client_type == META_WINDOW_CLIENT_TYPE_X11)
{
guint64 stack_id = top_level_window;
g_array_append_val (x11_hidden_stack_ids, stack_id);
}
g_array_append_val (x11_hidden_stack_ids, top_level_window);
continue;
}

View File

@ -30,7 +30,7 @@
#define NUM_RANDOM_RUNS 10000
static void
init_random_ness ()
init_random_ness (void)
{
srand(time(NULL));
}
@ -99,7 +99,7 @@ new_monitor_edge (int x, int y, int width, int height, int side_type)
}
static void
test_area ()
test_area (void)
{
MetaRectangle temp;
int i;
@ -116,7 +116,7 @@ test_area ()
}
static void
test_intersect ()
test_intersect (void)
{
MetaRectangle a = {100, 200, 50, 40};
MetaRectangle b = { 0, 50, 110, 152};
@ -144,7 +144,7 @@ test_intersect ()
}
static void
test_equal ()
test_equal (void)
{
MetaRectangle a = {10, 12, 4, 18};
MetaRectangle b = a;
@ -163,7 +163,7 @@ test_equal ()
}
static void
test_overlap_funcs ()
test_overlap_funcs (void)
{
MetaRectangle temp1, temp2;
int i;
@ -186,7 +186,7 @@ test_overlap_funcs ()
}
static void
test_basic_fitting ()
test_basic_fitting (void)
{
MetaRectangle temp1, temp2, temp3;
int i;
@ -357,7 +357,7 @@ get_monitor_edges (int which_monitor_set, int which_strut_set)
#if 0
static void
test_merge_regions ()
test_merge_regions (void)
{
/* logarithmically distributed random number of struts (range?)
* logarithmically distributed random size of struts (up to screen size???)
@ -579,7 +579,7 @@ verify_lists_are_equal (GList *code, GList *answer)
}
static void
test_regions_okay ()
test_regions_okay (void)
{
GList* region;
GList* tmp;
@ -665,7 +665,7 @@ test_regions_okay ()
}
static void
test_region_fitting ()
test_region_fitting (void)
{
GList* region;
MetaRectangle rect;
@ -709,7 +709,7 @@ test_region_fitting ()
}
static void
test_clamping_to_region ()
test_clamping_to_region (void)
{
GList* region;
MetaRectangle rect;
@ -826,7 +826,7 @@ rect_overlaps_region (const GList *spanning_rects,
gboolean time_to_print = FALSE;
static void
test_clipping_to_region ()
test_clipping_to_region (void)
{
GList* region;
MetaRectangle rect, temp;
@ -888,7 +888,7 @@ test_clipping_to_region ()
}
static void
test_shoving_into_region ()
test_shoving_into_region (void)
{
GList* region;
MetaRectangle rect, temp;
@ -1005,7 +1005,7 @@ verify_edge_lists_are_equal (GList *code, GList *answer)
}
static void
test_find_onscreen_edges ()
test_find_onscreen_edges (void)
{
GList* edges;
GList* tmp;
@ -1138,7 +1138,7 @@ test_find_onscreen_edges ()
}
static void
test_find_nonintersected_monitor_edges ()
test_find_nonintersected_monitor_edges (void)
{
GList* edges;
GList* tmp;
@ -1227,7 +1227,7 @@ test_find_nonintersected_monitor_edges ()
}
static void
test_gravity_resize ()
test_gravity_resize (void)
{
MetaRectangle oldrect, rect, temp;
@ -1329,7 +1329,7 @@ test_gravity_resize ()
#define EPSILON 0.000000001
static void
test_find_closest_point_to_line ()
test_find_closest_point_to_line (void)
{
double x1, y1, x2, y2, px, py, rx, ry;
double answer_x, answer_y;
@ -1381,7 +1381,7 @@ test_find_closest_point_to_line ()
}
int
main()
main(void)
{
init_random_ness ();
test_area ();

View File

@ -46,7 +46,7 @@
static void
meta_topic_real_valist (MetaDebugTopic topic,
const char *format,
va_list args);
va_list args) G_GNUC_PRINTF(2, 0);
#endif
static gint verbose_topics = 0;

View File

@ -763,10 +763,22 @@ meta_window_update_desc (MetaWindow *window)
{
g_clear_pointer (&window->desc, g_free);
if (window->title)
window->desc = g_strdup_printf ("0x%lx (%.10s)", window->xwindow, window->title);
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
{
if (window->title)
window->desc = g_strdup_printf ("0x%lx (%.10s)", window->xwindow, window->title);
else
window->desc = g_strdup_printf ("0x%lx", window->xwindow);
}
else
window->desc = g_strdup_printf ("0x%lx", window->xwindow);
{
guint64 small_stamp = window->stamp - G_GUINT64_CONSTANT(0x100000000);
if (window->title)
window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT " (%.10s)", small_stamp, window->title);
else
window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT , small_stamp);
}
}
static void
@ -3183,12 +3195,23 @@ meta_window_make_fullscreen (MetaWindow *window)
if (!window->fullscreen)
{
meta_window_make_fullscreen_internal (window);
MetaRectangle old_frame_rect, old_buffer_rect;
meta_window_get_frame_rect (window, &old_frame_rect);
meta_window_get_buffer_rect (window, &old_buffer_rect);
meta_window_make_fullscreen_internal (window);
meta_window_move_resize_internal (window,
META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED,
(META_MOVE_RESIZE_MOVE_ACTION |
META_MOVE_RESIZE_RESIZE_ACTION |
META_MOVE_RESIZE_STATE_CHANGED |
META_MOVE_RESIZE_DONT_SYNC_COMPOSITOR),
NorthWestGravity,
window->unconstrained_rect);
meta_compositor_size_change_window (window->display->compositor,
window, META_SIZE_CHANGE_FULLSCREEN,
&old_frame_rect, &old_buffer_rect);
}
}
@ -3199,7 +3222,7 @@ meta_window_unmake_fullscreen (MetaWindow *window)
if (window->fullscreen)
{
MetaRectangle target_rect;
MetaRectangle old_frame_rect, old_buffer_rect, target_rect;
meta_topic (META_DEBUG_WINDOW_OPS,
"Unfullscreening %s\n", window->desc);
@ -3208,6 +3231,8 @@ meta_window_unmake_fullscreen (MetaWindow *window)
target_rect = window->saved_rect;
meta_window_frame_size_changed (window);
meta_window_get_frame_rect (window, &old_frame_rect);
meta_window_get_buffer_rect (window, &old_buffer_rect);
/* Window's size hints may have changed while maximized, making
* saved_rect invalid. #329152
@ -3222,10 +3247,17 @@ meta_window_unmake_fullscreen (MetaWindow *window)
set_net_wm_state (window);
meta_window_move_resize_internal (window,
META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED,
(META_MOVE_RESIZE_MOVE_ACTION |
META_MOVE_RESIZE_RESIZE_ACTION |
META_MOVE_RESIZE_STATE_CHANGED |
META_MOVE_RESIZE_DONT_SYNC_COMPOSITOR),
NorthWestGravity,
target_rect);
meta_compositor_size_change_window (window->display->compositor,
window, META_SIZE_CHANGE_UNFULLSCREEN,
&old_frame_rect, &old_buffer_rect);
meta_window_update_layer (window);
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_FULLSCREEN]);
@ -4312,8 +4344,8 @@ set_workspace_state (MetaWindow *window,
GList *l;
for (l = window->screen->workspaces; l != NULL; l = l->next)
{
MetaWorkspace *workspace = l->data;
meta_workspace_remove_window (workspace, window);
MetaWorkspace *ws = l->data;
meta_workspace_remove_window (ws, window);
}
}
@ -4327,8 +4359,8 @@ set_workspace_state (MetaWindow *window,
GList *l;
for (l = window->screen->workspaces; l != NULL; l = l->next)
{
MetaWorkspace *workspace = l->data;
meta_workspace_add_window (workspace, window);
MetaWorkspace *ws = l->data;
meta_workspace_add_window (ws, window);
}
}
@ -6272,7 +6304,7 @@ find_ancestor_func (MetaWindow *window,
* so by traversing the @transient's ancestors until it either locates @window
* or reaches an ancestor that is not transient.
*
* Return Value: (transfer none): %TRUE if window is an ancestor of transient.
* Return Value: %TRUE if window is an ancestor of transient.
*/
gboolean
meta_window_is_ancestor_of_transient (MetaWindow *window,
@ -7010,7 +7042,7 @@ meta_window_get_transient_for (MetaWindow *window)
* Returns pid of the process that created this window, if known (obtained from
* the _NET_WM_PID property).
*
* Return value: (transfer none): the pid, or -1 if not known.
* Return value: the pid, or -1 if not known.
*/
int
meta_window_get_pid (MetaWindow *window)

View File

@ -1055,7 +1055,7 @@ meta_workspace_get_onmonitor_region (MetaWorkspace *workspace,
}
#ifdef WITH_VERBOSE_MODE
static char *
static const char *
meta_motion_direction_to_string (MetaMotionDirection direction)
{
switch (direction)

View File

@ -57,6 +57,8 @@ typedef enum
typedef enum {
META_SIZE_CHANGE_MAXIMIZE,
META_SIZE_CHANGE_UNMAXIMIZE,
META_SIZE_CHANGE_FULLSCREEN,
META_SIZE_CHANGE_UNFULLSCREEN
} MetaSizeChange;
MetaCompositor *meta_compositor_new (MetaDisplay *display);

View File

@ -49,7 +49,7 @@ typedef enum
} MetaExitCode;
/* exit immediately */
void meta_exit (MetaExitCode code);
void meta_exit (MetaExitCode code) G_GNUC_NORETURN;
/* g_main_loop_quit() then fall out of main() */
void meta_quit (MetaExitCode code);

View File

@ -25,7 +25,7 @@
#include <string.h>
#include <X11/extensions/sync.h>
char *client_id = "0";
const char *client_id = "0";
static gboolean wayland;
GHashTable *windows;

View File

@ -1094,7 +1094,6 @@ main (int argc, char **argv)
if (all_tests)
{
GFile *test_dir = g_file_new_for_path (MUTTER_PKGDATADIR "/tests");
GError *error = NULL;
if (!find_metatests_in_directory (test_dir, tests, &error))
{
@ -1120,7 +1119,7 @@ main (int argc, char **argv)
/* Then initalize mutter with a different set of arguments */
char *fake_args[] = { NULL, "--wayland" };
char *fake_args[] = { NULL, (char *)"--wayland" };
fake_args[0] = argv[0];
char **fake_argv = fake_args;
int fake_argc = 2;

View File

@ -915,11 +915,9 @@ meta_theme_get_default (void)
switch (frame_type)
{
case META_FRAME_TYPE_NORMAL:
break;
case META_FRAME_TYPE_DIALOG:
case META_FRAME_TYPE_MODAL_DIALOG:
case META_FRAME_TYPE_ATTACHED:
layout->hide_buttons = TRUE;
break;
case META_FRAME_TYPE_MENU:
case META_FRAME_TYPE_UTILITY:

View File

@ -57,8 +57,6 @@ typedef struct _MetaWaylandDataSourceWayland
struct wl_resource *resource;
} MetaWaylandDataSourceWayland;
GType meta_wayland_data_source_wayland_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE_WITH_PRIVATE (MetaWaylandDataSource, meta_wayland_data_source,
G_TYPE_OBJECT);
G_DEFINE_TYPE (MetaWaylandDataSourceWayland, meta_wayland_data_source_wayland,
@ -405,8 +403,8 @@ destroy_data_device_origin (struct wl_listener *listener, void *data)
wl_container_of (listener, drag_grab, drag_origin_listener);
drag_grab->drag_origin = NULL;
data_device_end_drag_grab (drag_grab);
meta_wayland_data_device_set_dnd_source (&drag_grab->seat->data_device, NULL);
data_device_end_drag_grab (drag_grab);
}
static void
@ -415,8 +413,8 @@ drag_grab_data_source_destroyed (gpointer data, GObject *where_the_object_was)
MetaWaylandDragGrab *drag_grab = data;
drag_grab->drag_data_source = NULL;
data_device_end_drag_grab (drag_grab);
meta_wayland_data_device_set_dnd_source (&drag_grab->seat->data_device, NULL);
data_device_end_drag_grab (drag_grab);
}
static void
@ -745,12 +743,14 @@ meta_wayland_data_device_set_dnd_source (MetaWaylandDataDevice *data_device,
return;
if (data_device->dnd_data_source)
g_object_remove_weak_pointer (G_OBJECT (source),
g_object_remove_weak_pointer (G_OBJECT (data_device->dnd_data_source),
(gpointer *)&data_device->dnd_data_source);
data_device->dnd_data_source = source;
g_object_add_weak_pointer (G_OBJECT (source),
(gpointer *)&data_device->dnd_data_source);
if (source)
g_object_add_weak_pointer (G_OBJECT (data_device->dnd_data_source),
(gpointer *)&data_device->dnd_data_source);
wl_signal_emit (&data_device->dnd_ownership_signal, source);
}
@ -912,6 +912,12 @@ meta_wayland_data_device_set_keyboard_focus (MetaWaylandDataDevice *data_device)
MetaWaylandDataSource *source;
focus_client = meta_wayland_keyboard_get_focus_client (&seat->keyboard);
if (focus_client == data_device->focus_client)
return;
data_device->focus_client = focus_client;
if (!focus_client)
return;

View File

@ -55,13 +55,12 @@ struct _MetaWaylandDataDevice
struct wl_listener selection_data_source_listener;
struct wl_list resource_list;
MetaWaylandDragGrab *current_grab;
struct wl_client *focus_client;
struct wl_signal selection_ownership_signal;
struct wl_signal dnd_ownership_signal;
};
GType meta_wayland_data_source_get_type (void) G_GNUC_CONST;
void meta_wayland_data_device_manager_init (MetaWaylandCompositor *compositor);
void meta_wayland_data_device_init (MetaWaylandDataDevice *data_device);

View File

@ -53,6 +53,7 @@
#include "meta-wayland-private.h"
#include "meta-wayland-surface.h"
#include "meta-wayland-buffer.h"
#include "meta-xwayland.h"
#include "meta-cursor.h"
#include "meta-cursor-tracker-private.h"
#include "meta-surface-actor-wayland.h"
@ -74,7 +75,6 @@ struct _MetaWaylandSurfaceRoleCursor
MetaCursorSprite *cursor_sprite;
};
GType meta_wayland_surface_role_cursor_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaWaylandSurfaceRoleCursor,
meta_wayland_surface_role_cursor,
META_TYPE_WAYLAND_SURFACE_ROLE);
@ -820,9 +820,12 @@ cursor_sprite_prepare_at (MetaCursorSprite *cursor_sprite,
MetaScreen *screen = display->screen;
const MetaMonitorInfo *monitor;
monitor = meta_screen_get_monitor_for_point (screen, x, y);
meta_cursor_sprite_set_texture_scale (cursor_sprite,
(float)monitor->scale / surface->scale);
if (!meta_xwayland_is_xwayland_surface (surface))
{
monitor = meta_screen_get_monitor_for_point (screen, x, y);
meta_cursor_sprite_set_texture_scale (cursor_sprite,
(float)monitor->scale / surface->scale);
}
meta_wayland_surface_update_outputs (surface);
}

View File

@ -73,11 +73,8 @@ typedef struct
struct wl_listener sibling_destroy_listener;
} MetaWaylandSubsurfacePlacementOp;
GType meta_wayland_surface_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaWaylandSurface, meta_wayland_surface, G_TYPE_OBJECT);
GType meta_wayland_surface_role_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE_WITH_PRIVATE (MetaWaylandSurfaceRole,
meta_wayland_surface_role,
G_TYPE_OBJECT);
@ -87,7 +84,6 @@ struct _MetaWaylandSurfaceRoleSubsurface
MetaWaylandSurfaceRole parent;
};
GType meta_wayland_surface_role_subsurface_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaWaylandSurfaceRoleSubsurface,
meta_wayland_surface_role_subsurface,
META_TYPE_WAYLAND_SURFACE_ROLE);
@ -97,7 +93,6 @@ struct _MetaWaylandSurfaceRoleXdgSurface
MetaWaylandSurfaceRole parent;
};
GType meta_wayland_surface_role_xdg_surface_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaWaylandSurfaceRoleXdgSurface,
meta_wayland_surface_role_xdg_surface,
META_TYPE_WAYLAND_SURFACE_ROLE);
@ -107,7 +102,6 @@ struct _MetaWaylandSurfaceRoleXdgPopup
MetaWaylandSurfaceRole parent;
};
GType meta_wayland_surface_role_xdg_popup_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaWaylandSurfaceRoleXdgPopup,
meta_wayland_surface_role_xdg_popup,
META_TYPE_WAYLAND_SURFACE_ROLE);
@ -117,7 +111,6 @@ struct _MetaWaylandSurfaceRoleWlShellSurface
MetaWaylandSurfaceRole parent;
};
GType meta_wayland_surface_role_wl_shell_surface_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaWaylandSurfaceRoleWlShellSurface,
meta_wayland_surface_role_wl_shell_surface,
META_TYPE_WAYLAND_SURFACE_ROLE);
@ -127,7 +120,6 @@ struct _MetaWaylandSurfaceRoleDND
MetaWaylandSurfaceRole parent;
};
GType meta_wayland_surface_role_dnd_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaWaylandSurfaceRoleDND,
meta_wayland_surface_role_dnd,
META_TYPE_WAYLAND_SURFACE_ROLE);
@ -359,12 +351,6 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
return;
}
}
else if (META_IS_WAYLAND_SURFACE_ROLE_XDG_POPUP (surface->role))
{
/* Ignore commits if we couldn't grab the pointer */
if (!window)
return;
}
else
{
if (surface->buffer == NULL)
@ -377,10 +363,11 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
}
}
g_assert (window != NULL);
/* We resize X based surfaces according to X events */
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
/* Update the state of the MetaWindow if we still have one. We might not if
* the window was unmanaged (for example popup destroyed, NULL buffer attached to
* wl_shell_surface wl_surface, xdg_surface object was destroyed, etc).
*/
if (window && window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
{
MetaRectangle geom = { 0 };
@ -936,7 +923,6 @@ set_surface_is_on_output (MetaWaylandSurface *surface,
static void
surface_handle_output_destroy (MetaWaylandOutput *wayland_output,
GParamSpec *pspec,
MetaWaylandSurface *surface)
{
set_surface_is_on_output (surface, wayland_output, FALSE);

View File

@ -144,7 +144,7 @@ wl_compositor_create_region (struct wl_client *client,
meta_wayland_region_create (compositor, client, resource, id);
}
const static struct wl_compositor_interface meta_wayland_wl_compositor_interface = {
static const struct wl_compositor_interface meta_wayland_wl_compositor_interface = {
wl_compositor_create_surface,
wl_compositor_create_region
};
@ -272,6 +272,8 @@ set_gnome_env (const char *name,
}
}
static void meta_wayland_log_func (const char *, va_list) G_GNUC_PRINTF (1, 0);
static void
meta_wayland_log_func (const char *fmt,
va_list arg)

View File

@ -361,6 +361,8 @@ meta_window_wayland_main_monitor_changed (MetaWindow *window,
/* Window size. */
scale_rect_size (&window->rect, scale_factor);
scale_rect_size (&window->unconstrained_rect, scale_factor);
scale_rect_size (&window->saved_rect, scale_factor);
/* Window geometry offset (XXX: Need a better place, see
* meta_window_wayland_move_resize). */

View File

@ -39,8 +39,6 @@
#include "meta-xwayland-selection-private.h"
#include "meta-wayland-data-device.h"
GType meta_wayland_data_source_xwayland_get_type (void) G_GNUC_CONST;
#define INCR_CHUNK_SIZE (128 * 1024)
#define XDND_VERSION 5
@ -88,6 +86,7 @@ struct _MetaWaylandDataSourceXWayland
MetaWaylandDataSource parent;
MetaSelectionBridge *selection;
guint has_utf8_string_atom : 1;
};
struct _MetaXWaylandSelection {
@ -162,7 +161,6 @@ xdnd_send_enter (MetaXWaylandSelection *selection_data,
if (source_mime_types->size <= 3)
{
/* The mimetype atoms fit in this same message */
gchar **p;
gint i = 2;
wl_array_for_each (p, source_mime_types)
@ -412,27 +410,33 @@ x11_data_write_cb (GObject *object,
MetaSelectionBridge *selection = user_data;
X11SelectionData *data = selection->x11_selection;
GError *error = NULL;
gboolean success = TRUE;
g_output_stream_write_finish (G_OUTPUT_STREAM (object), res, &error);
if (data->incr)
if (error)
{
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
{
g_error_free (error);
return;
}
g_warning ("Error writing from X11 selection: %s\n", error->message);
g_error_free (error);
success = FALSE;
}
if (success && data->incr)
{
Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
XDeleteProperty (xdisplay, selection->window,
gdk_x11_get_xatom_by_name ("_META_SELECTION"));
}
if (error)
else
{
if (error->domain != G_IO_ERROR ||
error->code != G_IO_ERROR_CANCELLED)
g_warning ("Error writing from X11 selection: %s\n", error->message);
g_error_free (error);
x11_selection_data_finish (selection, success);
}
if (!data->incr)
x11_selection_data_finish (selection, TRUE);
}
static void
@ -707,7 +711,8 @@ meta_x11_source_send (MetaWaylandDataSource *source,
MetaSelectionBridge *selection = source_xwayland->selection;
Atom type_atom;
if (strcmp (mime_type, "text/plain;charset=utf-8") == 0)
if (source_xwayland->has_utf8_string_atom &&
strcmp (mime_type, "text/plain;charset=utf-8") == 0)
type_atom = gdk_x11_get_xatom_by_name ("UTF8_STRING");
else
type_atom = gdk_x11_get_xatom_by_name (mime_type);
@ -850,6 +855,8 @@ meta_xwayland_data_source_fetch_mimetype_list (MetaWaylandDataSource *source,
Window window,
Atom prop)
{
MetaWaylandDataSourceXWayland *source_xwayland =
META_WAYLAND_DATA_SOURCE_XWAYLAND (source);
Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
gulong nitems_ret, bytes_after_ret, i;
Atom *atoms, type_ret, utf8_string;
@ -883,10 +890,13 @@ meta_xwayland_data_source_fetch_mimetype_list (MetaWaylandDataSource *source,
const gchar *mime_type;
if (atoms[i] == utf8_string)
mime_type = "text/plain;charset=utf-8";
else
mime_type = gdk_x11_get_xatom_name (atoms[i]);
{
meta_wayland_data_source_add_mime_type (source,
"text/plain;charset=utf-8");
source_xwayland->has_utf8_string_atom = TRUE;
}
mime_type = gdk_x11_get_xatom_name (atoms[i]);
meta_wayland_data_source_add_mime_type (source, mime_type);
}
@ -1280,6 +1290,9 @@ meta_xwayland_selection_handle_client_message (MetaWaylandCompositor *compositor
MetaWaylandDragGrab *drag_grab = compositor->seat->data_device.current_grab;
MetaWaylandSurface *drag_focus = meta_wayland_drag_grab_get_focus (drag_grab);
if (!drag_focus)
return FALSE;
if (event->message_type == xdnd_atoms[ATOM_DND_ENTER])
{
/* Bit 1 in data.l[1] determines whether there's 3 or less mimetype

View File

@ -45,7 +45,6 @@ struct _MetaWaylandSurfaceRoleXWayland
MetaWaylandSurfaceRole parent;
};
GType meta_wayland_surface_role_xwayland_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaWaylandSurfaceRoleXWayland,
meta_wayland_surface_role_xwayland,
META_TYPE_WAYLAND_SURFACE_ROLE);
@ -56,13 +55,6 @@ associate_window_with_surface (MetaWindow *window,
{
MetaDisplay *display = window->display;
/* If the window has an existing surface, like if we're
* undecorating or decorating the window, then we need
* to detach the window from its old surface.
*/
if (window->surface)
window->surface->window = NULL;
if (!meta_wayland_surface_assign_role (surface,
META_TYPE_WAYLAND_SURFACE_ROLE_XWAYLAND))
{
@ -89,6 +81,16 @@ associate_window_with_surface_id (MetaXWaylandManager *manager,
{
struct wl_resource *resource;
/* If the window has an existing surface, like if we're
* undecorating or decorating the window, then we need
* to detach the window from its old surface.
*/
if (window->surface)
{
meta_wayland_surface_set_window (window->surface, NULL);
window->surface = NULL;
}
resource = wl_client_get_object (manager->client, surface_id);
if (resource)
{
@ -172,6 +174,15 @@ meta_xwayland_handle_wl_surface_id (MetaWindow *window,
}
}
gboolean
meta_xwayland_is_xwayland_surface (MetaWaylandSurface *surface)
{
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
MetaXWaylandManager *manager = &compositor->xwayland_manager;
return wl_resource_get_client (surface->resource) == manager->client;
}
static gboolean
try_display (int display,
char **filename_out,

View File

@ -28,8 +28,13 @@
#include <glib.h>
#include <meta/types.h>
#include "wayland/meta-wayland-types.h"
void
meta_xwayland_handle_wl_surface_id (MetaWindow *window,
guint32 surface_id);
gboolean
meta_xwayland_is_xwayland_surface (MetaWaylandSurface *surface);
#endif /* META_XWAYLAND_H */

View File

@ -312,8 +312,8 @@ meta_session_init (const char *previous_client_id,
prgname = g_get_prgname ();
prop1.name = SmProgram;
prop1.type = SmARRAY8;
prop1.name = (char *)SmProgram;
prop1.type = (char *)SmARRAY8;
prop1.num_vals = 1;
prop1.vals = &prop1val;
prop1val.value = (char *)prgname;
@ -322,38 +322,38 @@ meta_session_init (const char *previous_client_id,
/* twm sets getuid() for this, but the SM spec plainly
* says pw_name, twm is on crack
*/
prop2.name = SmUserID;
prop2.type = SmARRAY8;
prop2.name = (char *)SmUserID;
prop2.type = (char *)SmARRAY8;
prop2.num_vals = 1;
prop2.vals = &prop2val;
prop2val.value = (char*) g_get_user_name ();
prop2val.length = strlen (prop2val.value);
prop3.name = SmRestartStyleHint;
prop3.type = SmCARD8;
prop3.name = (char *)SmRestartStyleHint;
prop3.type = (char *)SmCARD8;
prop3.num_vals = 1;
prop3.vals = &prop3val;
prop3val.value = &hint;
prop3val.length = 1;
sprintf (pid, "%d", getpid ());
prop4.name = SmProcessID;
prop4.type = SmARRAY8;
prop4.name = (char *)SmProcessID;
prop4.type = (char *)SmARRAY8;
prop4.num_vals = 1;
prop4.vals = &prop4val;
prop4val.value = pid;
prop4val.length = strlen (prop4val.value);
/* Always start in home directory */
prop5.name = SmCurrentDirectory;
prop5.type = SmARRAY8;
prop5.name = (char *)SmCurrentDirectory;
prop5.type = (char *)SmARRAY8;
prop5.num_vals = 1;
prop5.vals = &prop5val;
prop5val.value = (char*) g_get_home_dir ();
prop5val.length = strlen (prop5val.value);
prop6.name = "_GSM_Priority";
prop6.type = SmCARD8;
prop6.name = (char *)"_GSM_Priority";
prop6.type = (char *)SmCARD8;
prop6.num_vals = 1;
prop6.vals = &prop6val;
prop6val.value = &priority;
@ -588,15 +588,15 @@ set_clone_restart_commands (void)
/* Restart (use same client ID) */
prop1.name = SmRestartCommand;
prop1.type = SmLISTofARRAY8;
prop1.name = (char *)SmRestartCommand;
prop1.type = (char *)SmLISTofARRAY8;
g_return_if_fail (client_id);
i = 0;
restartv[i] = (char *)prgname;
++i;
restartv[i] = "--sm-client-id";
restartv[i] = (char *)"--sm-client-id";
++i;
restartv[i] = client_id;
++i;
@ -619,8 +619,8 @@ set_clone_restart_commands (void)
++i;
clonev[i] = NULL;
prop2.name = SmCloneCommand;
prop2.type = SmLISTofARRAY8;
prop2.name = (char *)SmCloneCommand;
prop2.type = (char *)SmLISTofARRAY8;
prop2.vals = g_new (SmPropValue, i);
i = 0;
@ -635,16 +635,16 @@ set_clone_restart_commands (void)
/* Discard */
i = 0;
discardv[i] = "rm";
discardv[i] = (char *)"rm";
++i;
discardv[i] = "-f";
discardv[i] = (char *)"-f";
++i;
discardv[i] = (char*) full_save_file ();
++i;
discardv[i] = NULL;
prop3.name = SmDiscardCommand;
prop3.type = SmLISTofARRAY8;
prop3.name = (char *)SmDiscardCommand;
prop3.type = (char *)SmLISTofARRAY8;
prop3.vals = g_new (SmPropValue, i);
i = 0;
@ -1792,8 +1792,8 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
return;
}
columns = g_slist_prepend (columns, "Window");
columns = g_slist_prepend (columns, "Class");
columns = g_slist_prepend (columns, (gpointer)"Window");
columns = g_slist_prepend (columns, (gpointer)"Class");
lame = g_slist_sort (lame, (GCompareFunc) windows_cmp_by_title);
@ -1803,7 +1803,7 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
MetaWindow *w = tmp->data;
lame_details = g_slist_prepend (lame_details,
w->res_class ? w->res_class : "");
w->res_class ? w->res_class : (gpointer)"");
lame_details = g_slist_prepend (lame_details,
w->title);

View File

@ -2000,12 +2000,16 @@ meta_window_move_resize_request (MetaWindow *window,
if (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION))
{
MetaRectangle rect, monitor_rect;
MetaRectangle old_frame_rect, old_buffer_rect;
gboolean legacy_fullscreen;
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
meta_window_get_frame_rect (window, &old_frame_rect);
meta_window_get_buffer_rect (window, &old_buffer_rect);
meta_screen_get_monitor_geometry (window->screen, window->monitor->number, &monitor_rect);
/* Workaround braindead legacy apps that don't know how to
@ -2015,12 +2019,14 @@ meta_window_move_resize_request (MetaWindow *window,
* if there are no struts making the workarea smaller than
* the monitor.
*/
if (meta_prefs_get_force_fullscreen() &&
!window->hide_titlebar_when_maximized &&
(window->decorated || !meta_window_is_client_decorated (window)) &&
meta_rectangle_equal (&rect, &monitor_rect) &&
window->has_fullscreen_func &&
!window->fullscreen)
legacy_fullscreen = (meta_prefs_get_force_fullscreen() &&
!window->hide_titlebar_when_maximized &&
(window->decorated || !meta_window_is_client_decorated (window)) &&
meta_rectangle_equal (&rect, &monitor_rect) &&
window->has_fullscreen_func &&
!window->fullscreen);
if (legacy_fullscreen)
{
/*
meta_topic (META_DEBUG_GEOMETRY,
@ -2030,11 +2036,17 @@ meta_window_move_resize_request (MetaWindow *window,
"fullscreen request\n",
window->desc);
meta_window_make_fullscreen_internal (window);
flags |= META_MOVE_RESIZE_DONT_SYNC_COMPOSITOR;
}
adjust_for_gravity (window, TRUE, gravity, &rect);
meta_window_client_rect_to_frame_rect (window, &rect, &rect);
meta_window_move_resize_internal (window, flags, gravity, rect);
if (legacy_fullscreen)
meta_compositor_size_change_window (window->display->compositor,
window, META_SIZE_CHANGE_FULLSCREEN,
&old_frame_rect, &old_buffer_rect);
}
}

View File

@ -507,7 +507,7 @@ window_from_results (GetPropertyResults *results,
if (!validate_or_free_results (results, 32, XA_WINDOW, TRUE))
return FALSE;
*window_p = *(Window*) results->prop;
*window_p = *(uint32_t *) results->prop;
g_free (results->prop);
results->prop = NULL;
@ -523,7 +523,7 @@ counter_from_results (GetPropertyResults *results,
TRUE))
return FALSE;
*counter_p = *(XSyncCounter*) results->prop;
*counter_p = *(uint32_t *) results->prop;
g_free (results->prop);
results->prop = NULL;