Compare commits
30 Commits
3.18.0
...
wip/fullsc
Author | SHA1 | Date | |
---|---|---|---|
88e466f8a8 | |||
377ecdb864 | |||
d7f544f42e | |||
1ab8b854df | |||
ae7aabd5de | |||
b975676c5d | |||
86d8c3954f | |||
54557f062e | |||
130807a308 | |||
e84f694668 | |||
b18542f2b6 | |||
da0aac665f | |||
8b0b0cf028 | |||
6f64d6b0aa | |||
ebeca983c7 | |||
cf88675807 | |||
405f1ce3d0 | |||
6190ae3873 | |||
69c267b142 | |||
9abc071283 | |||
a9df4bb81a | |||
bc9e63d3db | |||
5b5ceede2b | |||
4e63c95c02 | |||
67d3a7a2d7 | |||
bc00f118f3 | |||
5801b5518f | |||
25a796afc6 | |||
27b37407d0 | |||
e23e697043 |
@ -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,
|
||||
|
@ -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 *
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 },
|
||||
|
@ -44,7 +44,7 @@ print_version (const gchar *option_name,
|
||||
exit (0);
|
||||
}
|
||||
|
||||
static gchar *plugin = "default";
|
||||
static const char *plugin = "default";
|
||||
|
||||
GOptionEntry mutter_options[] = {
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 ();
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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). */
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user