From 441b854d41331a3a4147f5498ed157f47f252117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 28 Nov 2016 21:15:57 +0800 Subject: [PATCH] MetaScreen: Remove const qualifiers from monitor getters They will cause issues when monitors are stared in a GList. https://bugzilla.gnome.org/show_bug.cgi?id=777732 --- src/core/place.c | 2 +- src/core/screen-private.h | 26 +++++++++++++------------- src/core/screen.c | 18 +++++++++--------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/core/place.c b/src/core/place.c index decb59075..38118cf63 100644 --- a/src/core/place.c +++ b/src/core/place.c @@ -671,7 +671,7 @@ meta_window_place (MetaWindow *window, int *new_y) { GList *windows = NULL; - const MetaLogicalMonitor *logical_monitor; + MetaLogicalMonitor *logical_monitor; meta_topic (META_DEBUG_PLACEMENT, "Placing window %s\n", window->desc); diff --git a/src/core/screen-private.h b/src/core/screen-private.h index da7fbd86c..809c461dc 100644 --- a/src/core/screen-private.h +++ b/src/core/screen-private.h @@ -133,22 +133,22 @@ void meta_screen_hide_tile_preview (MetaScreen *screen); MetaWindow* meta_screen_get_mouse_window (MetaScreen *screen, MetaWindow *not_this_one); -const MetaLogicalMonitor * meta_screen_get_current_logical_monitor (MetaScreen *screen); -const MetaLogicalMonitor * meta_screen_get_current_logical_monitor_for_pos (MetaScreen *screen, - int x, - int y); -const MetaLogicalMonitor * meta_screen_get_logical_monitor_for_rect (MetaScreen *screen, - MetaRectangle *rect); -const MetaLogicalMonitor * meta_screen_calculate_logical_monitor_for_window (MetaScreen *screen, - MetaWindow *window); - -const MetaLogicalMonitor * meta_screen_get_logical_monitor_for_point (MetaScreen *screen, +MetaLogicalMonitor * meta_screen_get_current_logical_monitor (MetaScreen *screen); +MetaLogicalMonitor * meta_screen_get_current_logical_monitor_for_pos (MetaScreen *screen, int x, int y); +MetaLogicalMonitor * meta_screen_get_logical_monitor_for_rect (MetaScreen *screen, + MetaRectangle *rect); +MetaLogicalMonitor * meta_screen_calculate_logical_monitor_for_window (MetaScreen *screen, + MetaWindow *window); -const MetaLogicalMonitor * meta_screen_get_monitor_neighbor (MetaScreen *screen, - int which_monitor, - MetaScreenDirection dir); +MetaLogicalMonitor * meta_screen_get_logical_monitor_for_point (MetaScreen *screen, + int x, + int y); + +MetaLogicalMonitor * meta_screen_get_monitor_neighbor (MetaScreen *screen, + int which_monitor, + MetaScreenDirection dir); void meta_screen_update_workspace_layout (MetaScreen *screen); void meta_screen_update_workspace_names (MetaScreen *screen); diff --git a/src/core/screen.c b/src/core/screen.c index 1023fd7be..d3ed1c4e3 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -1248,7 +1248,7 @@ root_cursor_prepare_at (MetaCursorSprite *cursor_sprite, int y, MetaScreen *screen) { - const MetaLogicalMonitor *logical_monitor; + MetaLogicalMonitor *logical_monitor; logical_monitor = meta_screen_get_logical_monitor_for_point (screen, x, y); @@ -1408,7 +1408,7 @@ meta_screen_get_mouse_window (MetaScreen *screen, return window; } -const MetaLogicalMonitor * +MetaLogicalMonitor * meta_screen_get_logical_monitor_for_rect (MetaScreen *screen, MetaRectangle *rect) { @@ -1461,7 +1461,7 @@ meta_screen_get_logical_monitor_for_rect (MetaScreen *screen, return &logical_monitors[best_monitor]; } -const MetaLogicalMonitor * +MetaLogicalMonitor * meta_screen_calculate_logical_monitor_for_window (MetaScreen *screen, MetaWindow *window) { @@ -1476,13 +1476,13 @@ int meta_screen_get_monitor_index_for_rect (MetaScreen *screen, MetaRectangle *rect) { - const MetaLogicalMonitor *monitor; + MetaLogicalMonitor *monitor; monitor = meta_screen_get_logical_monitor_for_rect (screen, rect); return monitor->number; } -const MetaLogicalMonitor * +MetaLogicalMonitor * meta_screen_get_logical_monitor_for_point (MetaScreen *screen, int x, int y) @@ -1510,7 +1510,7 @@ meta_screen_get_logical_monitor_for_point (MetaScreen *screen, return NULL; } -const MetaLogicalMonitor * +MetaLogicalMonitor * meta_screen_get_monitor_neighbor (MetaScreen *screen, int which_monitor, MetaScreenDirection direction) @@ -1558,7 +1558,7 @@ meta_screen_get_monitor_neighbor_index (MetaScreen *screen, int which_monitor, MetaScreenDirection direction) { - const MetaLogicalMonitor *logical_monitor; + MetaLogicalMonitor *logical_monitor; logical_monitor = meta_screen_get_monitor_neighbor (screen, which_monitor, @@ -1566,7 +1566,7 @@ meta_screen_get_monitor_neighbor_index (MetaScreen *screen, return logical_monitor ? logical_monitor->number : -1; } -const MetaLogicalMonitor * +MetaLogicalMonitor * meta_screen_get_current_logical_monitor (MetaScreen *screen) { MetaBackend *backend = meta_get_backend (); @@ -1584,7 +1584,7 @@ meta_screen_get_current_logical_monitor (MetaScreen *screen) return &logical_monitors[monitor_index]; } -const MetaLogicalMonitor * +MetaLogicalMonitor * meta_screen_get_current_logical_monitor_for_pos (MetaScreen *screen, int x, int y)