Compare commits

...

5 Commits

Author SHA1 Message Date
Florian Müllner
bcd6103c44 Bump version to 3.30.2
Update NEWS.
2018-11-13 23:27:20 +01:00
Olivier Fourdan
8eabfaaa8b window: Really force update monitor on hot plugs
Commit 8d3e05305 ("window: Force update monitor on hot plugs") added the
flag `META_WINDOW_UPDATE_MONITOR_FLAGS_FORCE` passed to
`update_monitor()` from `update_for_monitors_changed()`.

However, `update_for_monitors_changed()` may choose to call another code
path to `move_between_rects()` and `meta_window_move_resize_internal()`
eventually.

As `meta_window_move_resize_internal()` does not use the "force" flag,
we may still end up in case where the window->monitor is left unchanged.

To avoid that problem, add a new `MetaMoveResizeFlags` that
`update_for_monitors_changed()` can use to force the monitor update from
`meta_window_move_resize_internal()`.

Fixes: 8d3e05305 ("window: Force update monitor on hot plugs")
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/189


(cherry picked from commit fa495286a1)
2018-11-13 09:22:01 +00:00
Andrea Azzarone
1d863f4d3e x11: close display in an idle function
Closing a GdkDisplay during an event handler is not currently supported by Gdk
and it will result in a crash when doing e.g. 'mutter --replace'. Using an idle
function will close it safely in a subsequent main loop iteration.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/595
2018-11-08 10:30:13 +00:00
Dušan Kazik
1abab3fe2e Update Slovak translation 2018-10-27 19:20:13 +00:00
Carlos Garnacho
d364fa50ba wayland: Defer text_input.done on an idle
IBus naturally doesn't know how to implement the text-input protocol,
and some input methods emit event streams that are incompatible with the
protocol, if not assumed to be part of an grouped series of events. As
IBus doesn't have any API to let us know about such groupings, let's
fake it by adding a specially crafted idle callback.

The idle callback has a known limitation; if there is an idle callback
with a higher priority, that either doesn't remove itself, or
reschedules itself before the next idle, we'll never get triggered.
This, however, is unlikely to actually be the bigger problem in such
situations, as it'd likely mean we'd have a 100% CPU bug.

https://gitlab.gnome.org/GNOME/gtk/issues/1365
2018-10-22 16:50:36 +00:00
9 changed files with 176 additions and 71 deletions

15
NEWS
View File

@@ -1,3 +1,18 @@
3.30.2
======
* Fix handling of non-UTF8 encodings [Florian; !227]
* Fix memory leaks introduced in 3.30.1 [Jonas; #653]
* Work around hangul text input bug [Carlos; gtk#1365]
* Fix crash when restarting window manager [Andrea; gnome-shell#595]
* Fix crash on monitor hotplug [Olivier; #189]
Contributors:
Jonas Ådahl, Andrea Azzarone, Olivier Fourdan, Carlos Garnacho,
Florian Müllner, Akira Nakajima
Translators:
Dušan Kazik [sk]
3.30.1 3.30.1
====== ======
* Improve trackball detection [Tony; #258] * Improve trackball detection [Tony; #258]

View File

@@ -2,7 +2,7 @@ AC_PREREQ(2.62)
m4_define([mutter_major_version], [3]) m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [30]) m4_define([mutter_minor_version], [30])
m4_define([mutter_micro_version], [1]) m4_define([mutter_micro_version], [2])
m4_define([mutter_version], m4_define([mutter_version],
[mutter_major_version.mutter_minor_version.mutter_micro_version]) [mutter_major_version.mutter_minor_version.mutter_micro_version])

113
po/sk.po
View File

@@ -13,8 +13,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: mutter\n" "Project-Id-Version: mutter\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-02-06 04:14+0000\n" "POT-Creation-Date: 2018-10-22 16:18+0000\n"
"PO-Revision-Date: 2018-03-17 21:52+0100\n" "PO-Revision-Date: 2018-10-27 21:19+0200\n"
"Last-Translator: Dušan Kazik <prescott66@gmail.com>\n" "Last-Translator: Dušan Kazik <prescott66@gmail.com>\n"
"Language-Team: Slovak <gnome-sk-list@gnome.org>\n" "Language-Team: Slovak <gnome-sk-list@gnome.org>\n"
"Language: sk\n" "Language: sk\n"
@@ -22,7 +22,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 1 : (n>=2 && n<=4) ? 2 : 0;\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 1 : (n>=2 && n<=4) ? 2 : 0;\n"
"X-Generator: Poedit 2.0.6\n" "X-Generator: Poedit 2.2\n"
#: data/50-mutter-navigation.xml:6 #: data/50-mutter-navigation.xml:6
msgid "Navigation" msgid "Navigation"
@@ -468,29 +468,26 @@ msgid ""
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes " "proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
"mutter default to layout logical monitors in a logical pixel coordinate " "mutter default to layout logical monitors in a logical pixel coordinate "
"space, while scaling monitor framebuffers instead of window content, to " "space, while scaling monitor framebuffers instead of window content, to "
"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — " "manage HiDPI monitors. Does not require a restart."
"enables remote desktop support. To support remote desktop with screen "
"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables "
"screen cast support."
msgstr "" msgstr ""
# summary # summary
#: data/org.gnome.mutter.gschema.xml.in:145 #: data/org.gnome.mutter.gschema.xml.in:141
msgid "Select window from tab popup" msgid "Select window from tab popup"
msgstr "Vybrať okno z rozbaľovacej ponuky tabulátora" msgstr "Vybrať okno z rozbaľovacej ponuky tabulátora"
# summary # summary
#: data/org.gnome.mutter.gschema.xml.in:150 #: data/org.gnome.mutter.gschema.xml.in:146
msgid "Cancel tab popup" msgid "Cancel tab popup"
msgstr "Zrušit rozbaľovaciu ponuku tabulátora" msgstr "Zrušit rozbaľovaciu ponuku tabulátora"
# PK: predpokladam ze to prepisane medzi tlacidlami # PK: predpokladam ze to prepisane medzi tlacidlami
# description # description
#: data/org.gnome.mutter.gschema.xml.in:155 #: data/org.gnome.mutter.gschema.xml.in:151
msgid "Switch monitor configurations" msgid "Switch monitor configurations"
msgstr "Prepnúť nastavenia monitorov" msgstr "Prepnúť nastavenia monitorov"
#: data/org.gnome.mutter.gschema.xml.in:160 #: data/org.gnome.mutter.gschema.xml.in:156
msgid "Rotates the built-in monitor configuration" msgid "Rotates the built-in monitor configuration"
msgstr "Otočí nastavenie vstavaného monitora" msgstr "Otočí nastavenie vstavaného monitora"
@@ -587,7 +584,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between #. TRANSLATORS: This string refers to a button that switches between
#. * different modes. #. * different modes.
#. #.
#: src/backends/meta-input-settings.c:2260 #: src/backends/meta-input-settings.c:2310
#, c-format #, c-format
msgid "Mode Switch (Group %d)" msgid "Mode Switch (Group %d)"
msgstr "Prepínač režimu (skupina č. %d)" msgstr "Prepínač režimu (skupina č. %d)"
@@ -597,30 +594,30 @@ msgstr "Prepínač režimu (skupina č. %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs. #. * mapping through the available outputs.
#. #.
#: src/backends/meta-input-settings.c:2283 #: src/backends/meta-input-settings.c:2333
msgid "Switch monitor" msgid "Switch monitor"
msgstr "Prepnúť monitor" msgstr "Prepnúť monitor"
#: src/backends/meta-input-settings.c:2285 #: src/backends/meta-input-settings.c:2335
msgid "Show on-screen help" msgid "Show on-screen help"
msgstr "Zobraziť pomocníka na obrazovke" msgstr "Zobraziť pomocníka na obrazovke"
#: src/backends/meta-monitor-manager.c:900 #: src/backends/meta-monitor-manager.c:888
msgid "Built-in display" msgid "Built-in display"
msgstr "Vstavaný displej" msgstr "Vstavaný displej"
#: src/backends/meta-monitor-manager.c:923 #: src/backends/meta-monitor-manager.c:911
msgid "Unknown" msgid "Unknown"
msgstr "Neznámy" msgstr "Neznámy"
#: src/backends/meta-monitor-manager.c:925 #: src/backends/meta-monitor-manager.c:913
msgid "Unknown Display" msgid "Unknown Display"
msgstr "Neznámy displej" msgstr "Neznámy displej"
#. TRANSLATORS: this is a monitor vendor name, followed by a #. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"' #. * size in inches, like 'Dell 15"'
#. #.
#: src/backends/meta-monitor-manager.c:933 #: src/backends/meta-monitor-manager.c:921
#, c-format #, c-format
msgid "%s %s" msgid "%s %s"
msgstr "%s %s" msgstr "%s %s"
@@ -634,86 +631,84 @@ msgid ""
msgstr "" msgstr ""
"Pre obrazovku č. %i na displeji „%s“ je spustený už iný správca rozloženia." "Pre obrazovku č. %i na displeji „%s“ je spustený už iný správca rozloženia."
#: src/core/bell.c:194 #: src/core/bell.c:254
msgid "Bell event" msgid "Bell event"
msgstr "Udalosť zvončeka" msgstr "Udalosť zvončeka"
# X window system preloz, napr. system na spravu okien X
#: src/core/display.c:608
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "Zlyhalo otvorenie displeja systému na správu okien X „%s“\n"
# cmd desc # cmd desc
#: src/core/main.c:190 #: src/core/main.c:191
msgid "Disable connection to session manager" msgid "Disable connection to session manager"
msgstr "Zakáže pripojenia k správcovi relácií" msgstr "Zakáže pripojenia k správcovi relácií"
# cmd desc # cmd desc
#: src/core/main.c:196 #: src/core/main.c:197
msgid "Replace the running window manager" msgid "Replace the running window manager"
msgstr "Nahradí bežiaceho správcu okien" msgstr "Nahradí bežiaceho správcu okien"
# cmd desc # cmd desc
#: src/core/main.c:202 #: src/core/main.c:203
msgid "Specify session management ID" msgid "Specify session management ID"
msgstr "Zadá identifikátor správy relácií" msgstr "Zadá identifikátor správy relácií"
#: src/core/main.c:207 #: src/core/main.c:208
msgid "X Display to use" msgid "X Display to use"
msgstr "X displej, ktorý bude použitý" msgstr "X displej, ktorý bude použitý"
# cmd desc # cmd desc
#: src/core/main.c:213 #: src/core/main.c:214
msgid "Initialize session from savefile" msgid "Initialize session from savefile"
msgstr "Inicializuje reláciu z uloženého súboru" msgstr "Inicializuje reláciu z uloženého súboru"
# cmd desc # cmd desc
#: src/core/main.c:219 #: src/core/main.c:220
msgid "Make X calls synchronous" msgid "Make X calls synchronous"
msgstr "Použije synchrónne volania X" msgstr "Použije synchrónne volania X"
# cmd desc # cmd desc
#: src/core/main.c:226 #: src/core/main.c:227
msgid "Run as a wayland compositor" msgid "Run as a wayland compositor"
msgstr "Spustí ako kompozitor protokolu wayland" msgstr "Spustí ako kompozitor protokolu wayland"
# cmd desc # cmd desc
#: src/core/main.c:232 #: src/core/main.c:233
msgid "Run as a nested compositor" msgid "Run as a nested compositor"
msgstr "Spustí ako kompozitor s vnoreným režimom" msgstr "Spustí ako kompozitor s vnoreným režimom"
#: src/core/main.c:240 #: src/core/main.c:239
msgid "Run wayland compositor without starting Xwayland"
msgstr ""
#: src/core/main.c:247
msgid "Run as a full display server, rather than nested" msgid "Run as a full display server, rather than nested"
msgstr "Spustí ako plnohodnotný zobrazovací server, namiesto vnoreného režimu" msgstr "Spustí ako plnohodnotný zobrazovací server, namiesto vnoreného režimu"
#: src/core/main.c:246 #: src/core/main.c:253
msgid "Run with X11 backend" msgid "Run with X11 backend"
msgstr "Spustí s obslužným programom X11" msgstr "Spustí s obslužným programom X11"
# %s is a window title # %s is a window title
#. Translators: %s is a window title #. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:147 #: src/core/meta-close-dialog-default.c:148
#, c-format #, c-format
msgid "“%s” is not responding." msgid "“%s” is not responding."
msgstr "„%s“ neodpovedá." msgstr "„%s“ neodpovedá."
#: src/core/meta-close-dialog-default.c:149 #: src/core/meta-close-dialog-default.c:150
msgid "Application is not responding." msgid "Application is not responding."
msgstr "Aplikácia neodpovedá." msgstr "Aplikácia neodpovedá."
#: src/core/meta-close-dialog-default.c:154 #: src/core/meta-close-dialog-default.c:155
msgid "" msgid ""
"You may choose to wait a short while for it to continue or force the " "You may choose to wait a short while for it to continue or force the "
"application to quit entirely." "application to quit entirely."
msgstr "" msgstr ""
"Môžete chvíľu počkať na pokračovanie aplikácie, alebo ju môžete ukončiť." "Môžete chvíľu počkať na pokračovanie aplikácie, alebo ju môžete ukončiť."
#: src/core/meta-close-dialog-default.c:161 #: src/core/meta-close-dialog-default.c:162
msgid "_Force Quit" msgid "_Force Quit"
msgstr "_Vynútiť ukončenie" msgstr "_Vynútiť ukončenie"
#: src/core/meta-close-dialog-default.c:161 #: src/core/meta-close-dialog-default.c:162
msgid "_Wait" msgid "_Wait"
msgstr "_Počkať" msgstr "_Počkať"
@@ -742,12 +737,21 @@ msgstr "Zobrazí verziu"
msgid "Mutter plugin to use" msgid "Mutter plugin to use"
msgstr "Použije zásuvný modul Mutter" msgstr "Použije zásuvný modul Mutter"
#: src/core/prefs.c:1997 #: src/core/prefs.c:1787
#, c-format #, c-format
msgid "Workspace %d" msgid "Workspace %d"
msgstr "Pracovný priestor č. %d" msgstr "Pracovný priestor č. %d"
#: src/core/screen.c:583 #: src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter bol skompilovaný bez výpisu podrobností pri behu\n"
#: src/wayland/meta-wayland-tablet-pad.c:567
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Prepínač režimu: Režim č. %d"
#: src/x11/meta-x11-display.c:666
#, c-format #, c-format
msgid "" msgid ""
"Display “%s” already has a window manager; try using the --replace option to " "Display “%s” already has a window manager; try using the --replace option to "
@@ -756,21 +760,22 @@ msgstr ""
"Displej „%s“ už má správcu okien. Skúste použiť prepínač --replace, aby sa " "Displej „%s“ už má správcu okien. Skúste použiť prepínač --replace, aby sa "
"aktuálny správca nahradil." "aktuálny správca nahradil."
#: src/core/screen.c:668 #: src/x11/meta-x11-display.c:1010
msgid "Failed to initialize GDK\n"
msgstr "Zlyhala inicializácia rozhrania GDK\n"
# X window system preloz, napr. system na spravu okien X
#: src/x11/meta-x11-display.c:1034
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "Zlyhalo otvorenie displeja systému na správu okien X „%s“\n"
#: src/x11/meta-x11-display.c:1117
#, c-format #, c-format
msgid "Screen %d on display “%s” is invalid\n" msgid "Screen %d on display “%s” is invalid\n"
msgstr "Obrazovka č. %d na displeji „%s“ nie je platná\n" msgstr "Obrazovka č. %d na displeji „%s“ nie je platná\n"
#: src/core/util.c:120 #: src/x11/session.c:1819
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter bol skompilovaný bez výpisu podrobností pri behu\n"
#: src/wayland/meta-wayland-tablet-pad.c:563
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Prepínač režimu: Režim č. %d"
#: src/x11/session.c:1818
msgid "" msgid ""
"These windows do not support “save current setup” and will have to be " "These windows do not support “save current setup” and will have to be "
"restarted manually next time you log in." "restarted manually next time you log in."
@@ -779,7 +784,7 @@ msgstr ""
"prihlásení ich budete musieť znovu spustiť ručne." "prihlásení ich budete musieť znovu spustiť ručne."
# window title; wm_client_machine # window title; wm_client_machine
#: src/x11/window-props.c:559 #: src/x11/window-props.c:565
#, c-format #, c-format
msgid "%s (on %s)" msgid "%s (on %s)"
msgstr "%s (na %s)" msgstr "%s (na %s)"

View File

@@ -82,6 +82,7 @@ typedef enum
META_MOVE_RESIZE_UNMAXIMIZE = 1 << 6, META_MOVE_RESIZE_UNMAXIMIZE = 1 << 6,
META_MOVE_RESIZE_FORCE_MOVE = 1 << 7, META_MOVE_RESIZE_FORCE_MOVE = 1 << 7,
META_MOVE_RESIZE_WAYLAND_STATE_CHANGED = 1 << 8, META_MOVE_RESIZE_WAYLAND_STATE_CHANGED = 1 << 8,
META_MOVE_RESIZE_FORCE_UPDATE_MONITOR = 1 << 9,
} MetaMoveResizeFlags; } MetaMoveResizeFlags;
typedef enum typedef enum

View File

@@ -121,6 +121,7 @@ static gboolean queue_calc_showing_func (MetaWindow *window,
void *data); void *data);
static void meta_window_move_between_rects (MetaWindow *window, static void meta_window_move_between_rects (MetaWindow *window,
MetaMoveResizeFlags move_resize_flags,
const MetaRectangle *old_area, const MetaRectangle *old_area,
const MetaRectangle *new_area); const MetaRectangle *new_area);
@@ -3865,6 +3866,7 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
* monitors changed and the same index could be refereing * monitors changed and the same index could be refereing
* to a different monitor. */ * to a different monitor. */
meta_window_move_between_rects (window, meta_window_move_between_rects (window,
META_MOVE_RESIZE_FORCE_UPDATE_MONITOR,
&old->rect, &old->rect,
&new->rect); &new->rect);
} }
@@ -4046,6 +4048,8 @@ meta_window_move_resize_internal (MetaWindow *window,
update_monitor_flags = META_WINDOW_UPDATE_MONITOR_FLAGS_NONE; update_monitor_flags = META_WINDOW_UPDATE_MONITOR_FLAGS_NONE;
if (flags & META_MOVE_RESIZE_USER_ACTION) if (flags & META_MOVE_RESIZE_USER_ACTION)
update_monitor_flags |= META_WINDOW_UPDATE_MONITOR_FLAGS_USER_OP; update_monitor_flags |= META_WINDOW_UPDATE_MONITOR_FLAGS_USER_OP;
if (flags & META_MOVE_RESIZE_FORCE_UPDATE_MONITOR)
update_monitor_flags |= META_WINDOW_UPDATE_MONITOR_FLAGS_FORCE;
if (window->monitor) if (window->monitor)
{ {
@@ -4105,6 +4109,7 @@ meta_window_move_frame (MetaWindow *window,
static void static void
meta_window_move_between_rects (MetaWindow *window, meta_window_move_between_rects (MetaWindow *window,
MetaMoveResizeFlags move_resize_flags,
const MetaRectangle *old_area, const MetaRectangle *old_area,
const MetaRectangle *new_area) const MetaRectangle *new_area)
{ {
@@ -4128,7 +4133,12 @@ meta_window_move_between_rects (MetaWindow *window,
window->saved_rect.x = window->unconstrained_rect.x; window->saved_rect.x = window->unconstrained_rect.x;
window->saved_rect.y = window->unconstrained_rect.y; window->saved_rect.y = window->unconstrained_rect.y;
meta_window_move_resize_now (window); meta_window_move_resize_internal (window,
move_resize_flags |
META_MOVE_RESIZE_MOVE_ACTION |
META_MOVE_RESIZE_RESIZE_ACTION,
NorthWestGravity,
window->unconstrained_rect);
} }
/** /**
@@ -4189,14 +4199,14 @@ meta_window_move_to_monitor (MetaWindow *window,
window->unconstrained_rect.height == 0 || window->unconstrained_rect.height == 0 ||
!meta_rectangle_overlap (&window->unconstrained_rect, &old_area)) !meta_rectangle_overlap (&window->unconstrained_rect, &old_area))
{ {
meta_window_move_between_rects (window, NULL, &new_area); meta_window_move_between_rects (window, 0, NULL, &new_area);
} }
else else
{ {
if (monitor == window->monitor->number) if (monitor == window->monitor->number)
return; return;
meta_window_move_between_rects (window, &old_area, &new_area); meta_window_move_between_rects (window, 0, &old_area, &new_area);
} }
window->preferred_output_winsys_id = window->monitor->winsys_id; window->preferred_output_winsys_id = window->monitor->winsys_id;

View File

@@ -70,6 +70,8 @@ struct _MetaWaylandTextInput
uint32_t content_type_purpose; uint32_t content_type_purpose;
uint32_t text_change_cause; uint32_t text_change_cause;
gboolean enabled; gboolean enabled;
guint done_idle_id;
}; };
struct _MetaWaylandTextInputFocus struct _MetaWaylandTextInputFocus
@@ -114,6 +116,52 @@ increment_serial (MetaWaylandTextInput *text_input,
GUINT_TO_POINTER (serial + 1)); GUINT_TO_POINTER (serial + 1));
} }
static gboolean
done_idle_cb (gpointer user_data)
{
ClutterInputFocus *focus = user_data;
MetaWaylandTextInput *text_input;
struct wl_resource *resource;
text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;
wl_resource_for_each (resource, &text_input->focus_resource_list)
{
zwp_text_input_v3_send_done (resource,
lookup_serial (text_input, resource));
}
text_input->done_idle_id = 0;
return G_SOURCE_REMOVE;
}
static void
meta_wayland_text_input_focus_defer_done (ClutterInputFocus *focus)
{
MetaWaylandTextInput *text_input;
text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;
if (text_input->done_idle_id != 0)
return;
/* This operates on 3 principles:
* - GDBus uses G_PRIORITY_DEFAULT to put messages in the thread default main
* context.
* - All relevant ClutterInputFocus methods are ultimately backed by
* DBus methods inside IBus.
* - We want to run .done after them all. The slightly lower
* G_PRIORITY_DEFAULT + 1 priority should ensure we at least group
* all messages seen so far.
*
* FIXME: .done may be delayed indefinitely if there's a high enough
* priority idle source in the main loop. It's unlikely that
* recurring idles run at this high priority though.
*/
text_input->done_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT + 1,
done_idle_cb, focus, NULL);
}
static void static void
meta_wayland_text_input_focus_delete_surrounding (ClutterInputFocus *focus, meta_wayland_text_input_focus_delete_surrounding (ClutterInputFocus *focus,
guint cursor, guint cursor,
@@ -127,9 +175,9 @@ meta_wayland_text_input_focus_delete_surrounding (ClutterInputFocus *focus,
wl_resource_for_each (resource, &text_input->focus_resource_list) wl_resource_for_each (resource, &text_input->focus_resource_list)
{ {
zwp_text_input_v3_send_delete_surrounding_text (resource, cursor, len); zwp_text_input_v3_send_delete_surrounding_text (resource, cursor, len);
zwp_text_input_v3_send_done (resource,
lookup_serial (text_input, resource));
} }
meta_wayland_text_input_focus_defer_done (focus);
} }
static void static void
@@ -145,9 +193,9 @@ meta_wayland_text_input_focus_commit_text (ClutterInputFocus *focus,
{ {
zwp_text_input_v3_send_preedit_string (resource, NULL, 0, 0); zwp_text_input_v3_send_preedit_string (resource, NULL, 0, 0);
zwp_text_input_v3_send_commit_string (resource, text); zwp_text_input_v3_send_commit_string (resource, text);
zwp_text_input_v3_send_done (resource,
lookup_serial (text_input, resource));
} }
meta_wayland_text_input_focus_defer_done (focus);
} }
static void static void
@@ -163,9 +211,9 @@ meta_wayland_text_input_focus_set_preedit_text (ClutterInputFocus *focus,
wl_resource_for_each (resource, &text_input->focus_resource_list) wl_resource_for_each (resource, &text_input->focus_resource_list)
{ {
zwp_text_input_v3_send_preedit_string (resource, text, cursor, cursor); zwp_text_input_v3_send_preedit_string (resource, text, cursor, cursor);
zwp_text_input_v3_send_done (resource,
lookup_serial (text_input, resource));
} }
meta_wayland_text_input_focus_defer_done (focus);
} }
static void static void

View File

@@ -1138,6 +1138,18 @@ process_selection_request (MetaX11Display *x11_display,
meta_verbose ("Handled selection request\n"); meta_verbose ("Handled selection request\n");
} }
static gboolean
close_display_idle_cb (gpointer user_data)
{
MetaX11Display *x11_display = META_X11_DISPLAY (user_data);
meta_display_close (x11_display->display,
x11_display->xselectionclear_timestamp);
x11_display->display_close_idle = 0;
return G_SOURCE_REMOVE;
}
static gboolean static gboolean
process_selection_clear (MetaX11Display *x11_display, process_selection_clear (MetaX11Display *x11_display,
XEvent *event) XEvent *event)
@@ -1163,8 +1175,13 @@ process_selection_clear (MetaX11Display *x11_display,
meta_verbose ("Got selection clear for on display %s\n", meta_verbose ("Got selection clear for on display %s\n",
x11_display->name); x11_display->name);
meta_display_close (x11_display->display, /* We can't close a GdkDisplay in an even handler. */
event->xselectionclear.time); if (!x11_display->display_close_idle)
{
x11_display->xselectionclear_timestamp = event->xselectionclear.time;
x11_display->display_close_idle = g_idle_add (close_display_idle_cb, x11_display);
}
return TRUE; return TRUE;
} }
@@ -1818,11 +1835,8 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
{ {
if (process_selection_clear (x11_display, event)) if (process_selection_clear (x11_display, event))
{ {
/* This means we called meta_display_unmanage_screen, which bypass_gtk = TRUE;
* means the MetaDisplay is effectively dead. We don't want goto out;
* to poke into display->current_time below, since that would
* crash, so just directly return. */
return TRUE;
} }
} }

View File

@@ -92,6 +92,9 @@ struct _MetaX11Display
Atom wm_sn_atom; Atom wm_sn_atom;
guint32 wm_sn_timestamp; guint32 wm_sn_timestamp;
guint display_close_idle;
guint32 xselectionclear_timestamp;
Window wm_cm_selection_window; Window wm_cm_selection_window;
Window composite_overlay_window; Window composite_overlay_window;

View File

@@ -215,6 +215,12 @@ meta_x11_display_dispose (GObject *object)
x11_display->gdk_display = NULL; x11_display->gdk_display = NULL;
} }
if (x11_display->display_close_idle)
{
g_source_remove (x11_display->display_close_idle);
x11_display->display_close_idle = 0;
}
g_free (x11_display->name); g_free (x11_display->name);
x11_display->name = NULL; x11_display->name = NULL;
@@ -1186,6 +1192,9 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
x11_display->timestamp_pinging_window = None; x11_display->timestamp_pinging_window = None;
x11_display->wm_sn_selection_window = None; x11_display->wm_sn_selection_window = None;
x11_display->display_close_idle = 0;
x11_display->xselectionclear_timestamp = 0;
x11_display->last_bell_time = 0; x11_display->last_bell_time = 0;
x11_display->focus_serial = 0; x11_display->focus_serial = 0;
x11_display->server_focus_window = None; x11_display->server_focus_window = None;