35
36
using miral::WindowManagerTools;
37
38
#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 5, 0)
38
auto const mir_window_set_state = mir_surface_set_state;
39
auto const mir_event_type_window = mir_event_type_surface;
39
40
auto const mir_window_event_get_attribute = mir_surface_event_get_attribute;
40
41
auto const mir_event_get_window_event = mir_event_get_surface_event;
360
361
assert_active_window_is(test_name);
365
TEST_F(ActiveWindow, hiding_active_dialog_makes_parent_active)
367
char const* const parent_name = __PRETTY_FUNCTION__;
368
auto const dialog_name = "dialog";
369
auto const connection = connect_client(parent_name);
371
auto const parent = create_surface(connection, parent_name, sync1);
372
auto const dialog = create_dialog(connection, dialog_name, parent, sync2);
374
sync1.exec([&]{ mir_window_set_state(dialog, mir_window_state_hidden); });
376
EXPECT_TRUE(sync1.signal_raised());
378
assert_active_window_is(parent_name);
381
TEST_F(ActiveWindow, when_another_window_is_about_hiding_active_dialog_makes_parent_active)
383
FocusChangeSync sync3;
384
char const* const parent_name = __PRETTY_FUNCTION__;
385
auto const dialog_name = "dialog";
386
auto const another_window_name = "another window";
387
auto const connection = connect_client(parent_name);
389
auto const parent = create_surface(connection, parent_name, sync1);
390
auto const another_window = create_surface(connection, another_window_name, sync2);
391
auto const dialog = create_dialog(connection, dialog_name, parent, sync3);
393
sync1.exec([&]{ mir_window_set_state(dialog, mir_window_state_hidden); });
395
EXPECT_TRUE(sync1.signal_raised());
397
assert_active_window_is(parent_name);