tests/wayland-unit-tests: Make sure there are two workspaces
because we want to switch between two workspaces. In some configurations there is only a single workspace at this point so trying to get current workspace + 1 gets us a NULL pointer. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3730>
This commit is contained in:

committed by
Marge Bot

parent
5cac24346d
commit
301c154f02
@ -25,6 +25,7 @@
|
|||||||
#include "backends/native/meta-kms-device.h"
|
#include "backends/native/meta-kms-device.h"
|
||||||
#include "compositor/meta-window-actor-private.h"
|
#include "compositor/meta-window-actor-private.h"
|
||||||
#include "core/display-private.h"
|
#include "core/display-private.h"
|
||||||
|
#include "core/meta-workspace-manager-private.h"
|
||||||
#include "core/window-private.h"
|
#include "core/window-private.h"
|
||||||
#include "meta-test/meta-context-test.h"
|
#include "meta-test/meta-context-test.h"
|
||||||
#include "meta/meta-later.h"
|
#include "meta/meta-later.h"
|
||||||
@ -944,12 +945,18 @@ toplevel_suspended (void)
|
|||||||
{
|
{
|
||||||
MetaWaylandTestClient *wayland_test_client;
|
MetaWaylandTestClient *wayland_test_client;
|
||||||
gulong sync_point_id;
|
gulong sync_point_id;
|
||||||
|
MetaDisplay *display = meta_context_get_display (test_context);
|
||||||
|
uint32_t now_ms = meta_display_get_current_time_roundtrip (display);
|
||||||
|
MetaWorkspaceManager *workspace_manager =
|
||||||
|
meta_display_get_workspace_manager (display);
|
||||||
|
|
||||||
sync_point_id =
|
sync_point_id =
|
||||||
g_signal_connect (test_driver, "sync-point",
|
g_signal_connect (test_driver, "sync-point",
|
||||||
G_CALLBACK (on_toplevel_suspended_sync_point),
|
G_CALLBACK (on_toplevel_suspended_sync_point),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
meta_workspace_manager_update_num_workspaces (workspace_manager, now_ms, 2);
|
||||||
|
|
||||||
wayland_test_client =
|
wayland_test_client =
|
||||||
meta_wayland_test_client_new (test_context, "xdg-toplevel-suspended");
|
meta_wayland_test_client_new (test_context, "xdg-toplevel-suspended");
|
||||||
meta_wayland_test_client_finish (wayland_test_client);
|
meta_wayland_test_client_finish (wayland_test_client);
|
||||||
|
Reference in New Issue
Block a user