mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
output: Turn winsys_id into a uint64_t
We need a 64 bit field to combine the device id and connector id into the output id (winsys_id).
This commit is contained in:
parent
4bc6a64d47
commit
5e005316ef
@ -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;
|
||||
};
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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,
|
||||
|
@ -44,6 +44,8 @@ struct _MetaWaylandOutput
|
||||
|
||||
GList *resources;
|
||||
GList *xdg_output_resources;
|
||||
|
||||
uint64_t winsys_id;
|
||||
};
|
||||
|
||||
void meta_wayland_outputs_init (MetaWaylandCompositor *compositor);
|
||||
|
Loading…
Reference in New Issue
Block a user