Skip to content

Commit 3a8367f

Browse files
authored
[Wayland] Implement xdg-activation-v1 protocol (#725)
* [Wayland] Implement xdg-activation-v1 protocol * Small cleanup * window: Further allow new window to get activated before mapped
1 parent af71a8e commit 3a8367f

11 files changed

+501
-1
lines changed

src/core/startup-notification.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ enum
6262
enum
6363
{
6464
SEQ_COMPLETE,
65+
SEQ_TIMEOUT,
6566
N_SEQ_SIGNALS
6667
};
6768

@@ -268,6 +269,13 @@ meta_startup_sequence_class_init (MetaStartupSequenceClass *klass)
268269
NULL, NULL, NULL,
269270
G_TYPE_NONE, 0);
270271

272+
seq_signals[SEQ_TIMEOUT] =
273+
g_signal_new ("timeout",
274+
META_TYPE_STARTUP_SEQUENCE,
275+
G_SIGNAL_RUN_LAST,
276+
0, NULL, NULL, NULL,
277+
G_TYPE_NONE, 0);
278+
271279
seq_props[PROP_SEQ_ID] =
272280
g_param_spec_string ("id",
273281
"ID",
@@ -488,7 +496,11 @@ startup_sequence_timeout (void *data)
488496
"Timed out sequence %s\n",
489497
meta_startup_sequence_get_id (sequence));
490498

491-
meta_startup_sequence_complete (sequence);
499+
if (!meta_startup_sequence_get_completed (sequence))
500+
{
501+
g_signal_emit (sequence, seq_signals[SEQ_TIMEOUT], 0, sequence);
502+
meta_startup_sequence_complete (sequence);
503+
}
492504
meta_startup_notification_remove_sequence (sn, sequence);
493505
}
494506

src/core/window.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5578,6 +5578,13 @@ meta_window_raise (MetaWindow *window)
55785578

55795579
g_return_if_fail (!window->override_redirect);
55805580

5581+
/* Flush pending visible state now.
5582+
* It is important that this runs before meta_stack_raise() because
5583+
* showing a window may overwrite its stacking order based on the
5584+
* stacking rules for newly shown windows.
5585+
*/
5586+
meta_window_flush_calc_showing (window);
5587+
55815588
ancestor = meta_window_find_root_ancestor (window);
55825589

55835590
meta_topic (META_DEBUG_WINDOW_OPS,

src/meson.build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ if have_wayland
489489
'wayland/meta-pointer-lock-wayland.h',
490490
'wayland/meta-selection-source-wayland.c',
491491
'wayland/meta-selection-source-wayland-private.h',
492+
'wayland/meta-wayland-activation.c',
493+
'wayland/meta-wayland-activation.h',
492494
'wayland/meta-wayland-actor-surface.c',
493495
'wayland/meta-wayland-actor-surface.h',
494496
'wayland/meta-wayland-buffer.c',
@@ -806,6 +808,7 @@ if have_wayland
806808
['tablet', 'unstable', 'v2', ],
807809
['text-input', 'unstable', 'v3', ],
808810
['viewporter', 'stable', ],
811+
['xdg-activation', 'staging', 'v1', ],
809812
['xdg-dialog', 'staging', 'v1', ],
810813
['xdg-foreign', 'unstable', 'v1', ],
811814
['xdg-foreign', 'unstable', 'v2', ],

0 commit comments

Comments
 (0)