diff --git a/src/backends/meta-logical-monitor.h b/src/backends/meta-logical-monitor.h index 8c4132c24..1b39d2ce2 100644 --- a/src/backends/meta-logical-monitor.h +++ b/src/backends/meta-logical-monitor.h @@ -51,7 +51,7 @@ struct _MetaLogicalMonitor (it's an attempt to keep windows on the same monitor, and preferably on the primary one). */ - glong winsys_id; + uint64_t winsys_id; GList *monitors; }; diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c index 60f36741a..9f32354de 100644 --- a/src/backends/meta-monitor.c +++ b/src/backends/meta-monitor.c @@ -73,7 +73,7 @@ typedef struct _MetaMonitorPrivate * (it's an attempt to keep windows on the same monitor, and preferably on * the primary one). */ - long winsys_id; + uint64_t winsys_id; } MetaMonitorPrivate; G_DEFINE_TYPE_WITH_PRIVATE (MetaMonitor, meta_monitor, G_TYPE_OBJECT) diff --git a/src/backends/meta-output.h b/src/backends/meta-output.h index 4eadd6cdc..b943b2a76 100644 --- a/src/backends/meta-output.h +++ b/src/backends/meta-output.h @@ -66,7 +66,7 @@ struct _MetaOutput MetaGpu *gpu; /* The low-level ID of this output, used to apply back configuration */ - glong winsys_id; + uint64_t winsys_id; char *name; char *vendor; char *product; diff --git a/src/core/window-private.h b/src/core/window-private.h index 4cc05d934..c9ff6adbc 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -232,7 +232,7 @@ struct _MetaWindow double tile_hfraction; - int preferred_output_winsys_id; + uint64_t preferred_output_winsys_id; /* Whether we're shaded */ guint shaded : 1; diff --git a/src/core/window.c b/src/core/window.c index 4d9e51d8c..7a59272bb 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3798,7 +3798,7 @@ meta_window_get_main_logical_monitor (MetaWindow *window) static MetaLogicalMonitor * find_monitor_by_winsys_id (MetaWindow *window, - guint winsys_id) + uint64_t winsys_id) { MetaBackend *backend = meta_get_backend (); MetaMonitorManager *monitor_manager = @@ -4052,7 +4052,7 @@ meta_window_move_resize_internal (MetaWindow *window, if (window->monitor) { - guint old_output_winsys_id; + uint64_t old_output_winsys_id; old_output_winsys_id = window->monitor->winsys_id; diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c index 2b8207fc7..a58d9e153 100644 --- a/src/tests/monitor-unit-tests.c +++ b/src/tests/monitor-unit-tests.c @@ -136,7 +136,7 @@ typedef struct _MonitorTestCaseSetup typedef struct _MonitorTestCaseMonitorCrtcMode { - int output; + uint64_t output; int crtc_mode; } MetaTestCaseMonitorCrtcMode; @@ -151,7 +151,7 @@ typedef struct _MonitorTestCaseMonitorMode typedef struct _MonitorTestCaseMonitor { - long outputs[MAX_N_OUTPUTS]; + uint64_t outputs[MAX_N_OUTPUTS]; int n_outputs; MetaMonitorTestCaseMonitorMode modes[MAX_N_MODES]; int n_modes; @@ -409,7 +409,7 @@ destroy_monitor_test_clients (void) static MetaOutput * output_from_winsys_id (MetaMonitorManager *monitor_manager, - long winsys_id) + uint64_t winsys_id) { MetaMonitorManagerTest *monitor_manager_test = META_MONITOR_MANAGER_TEST (monitor_manager); @@ -714,7 +714,7 @@ check_monitor_configuration (MonitorTestCase *test_case) for (l_output = outputs, j = 0; l_output; l_output = l_output->next, j++) { MetaOutput *output = l_output->data; - long winsys_id = test_case->expect.monitors[i].outputs[j]; + uint64_t winsys_id = test_case->expect.monitors[i].outputs[j]; g_assert (output == output_from_winsys_id (monitor_manager, winsys_id)); diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c index cb393ddf5..b9f0cb34f 100644 --- a/src/wayland/meta-wayland-outputs.c +++ b/src/wayland/meta-wayland-outputs.c @@ -343,6 +343,8 @@ meta_wayland_output_set_logical_monitor (MetaWaylandOutput *wayland_output, wayland_output->mode_flags |= WL_OUTPUT_MODE_PREFERRED; wayland_output->scale = calculate_wayland_output_scale (logical_monitor); wayland_output->refresh_rate = meta_monitor_mode_get_refresh_rate (current_mode); + + wayland_output->winsys_id = logical_monitor->winsys_id; } static void @@ -456,25 +458,24 @@ meta_wayland_compositor_update_outputs (MetaWaylandCompositor *compositor, logical_monitors = meta_monitor_manager_get_logical_monitors (monitor_manager); - new_table = g_hash_table_new_full (NULL, NULL, NULL, + new_table = g_hash_table_new_full (g_int64_hash, g_int64_equal, NULL, wayland_output_destroy_notify); for (l = logical_monitors; l; l = l->next) { MetaLogicalMonitor *logical_monitor = l->data; - MetaWaylandOutput *wayland_output; + MetaWaylandOutput *wayland_output = NULL; if (logical_monitor->winsys_id == 0) continue; - wayland_output = - g_hash_table_lookup (compositor->outputs, - GSIZE_TO_POINTER (logical_monitor->winsys_id)); + wayland_output = g_hash_table_lookup (compositor->outputs, + &logical_monitor->winsys_id); if (wayland_output) { g_hash_table_steal (compositor->outputs, - GSIZE_TO_POINTER (logical_monitor->winsys_id)); + &logical_monitor->winsys_id); } else { @@ -483,7 +484,7 @@ meta_wayland_compositor_update_outputs (MetaWaylandCompositor *compositor, wayland_output_update_for_output (wayland_output, logical_monitor); g_hash_table_insert (new_table, - GSIZE_TO_POINTER (logical_monitor->winsys_id), + &wayland_output->winsys_id, wayland_output); } @@ -680,7 +681,8 @@ meta_wayland_outputs_init (MetaWaylandCompositor *compositor) g_signal_connect (monitors, "monitors-changed-internal", G_CALLBACK (on_monitors_changed), compositor); - compositor->outputs = g_hash_table_new_full (NULL, NULL, NULL, wayland_output_destroy_notify); + compositor->outputs = g_hash_table_new_full (g_int64_hash, g_int64_equal, NULL, + wayland_output_destroy_notify); compositor->outputs = meta_wayland_compositor_update_outputs (compositor, monitors); wl_global_create (compositor->wayland_display, diff --git a/src/wayland/meta-wayland-outputs.h b/src/wayland/meta-wayland-outputs.h index 739be4dd7..ff15a81bd 100644 --- a/src/wayland/meta-wayland-outputs.h +++ b/src/wayland/meta-wayland-outputs.h @@ -44,6 +44,8 @@ struct _MetaWaylandOutput GList *resources; GList *xdg_output_resources; + + uint64_t winsys_id; }; void meta_wayland_outputs_init (MetaWaylandCompositor *compositor);