[mutter] Move mouse window tracking to MetaDisplay
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Move mouse window tracking to MetaDisplay
- Date: Sat, 7 Jul 2018 10:00:04 +0000 (UTC)
commit 6458139c04dd6323196b5ef697dc3fbd456a8875
Author: Armin Krezović <krezovic armin gmail com>
Date: Sat Aug 26 21:35:28 2017 +0200
Move mouse window tracking to MetaDisplay
https://bugzilla.gnome.org/show_bug.cgi?id=759538
src/core/display-private.h | 3 +++
src/core/display.c | 23 +++++++++++++++++++++++
src/core/screen-private.h | 3 ---
src/core/screen.c | 23 -----------------------
src/core/workspace.c | 2 +-
5 files changed, 27 insertions(+), 27 deletions(-)
---
diff --git a/src/core/display-private.h b/src/core/display-private.h
index 4240f21c7..48a9c93cf 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -431,4 +431,7 @@ gboolean meta_display_apply_startup_properties (MetaDisplay *display,
void meta_display_queue_workarea_recalc (MetaDisplay *display);
void meta_display_queue_check_fullscreen (MetaDisplay *display);
+MetaWindow *meta_display_get_pointer_window (MetaDisplay *display,
+ MetaWindow *not_this_one);
+
#endif
diff --git a/src/core/display.c b/src/core/display.c
index 5bb8fdfb7..d00229cab 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -3622,3 +3622,26 @@ meta_display_get_monitor_in_fullscreen (MetaDisplay *display,
/* We use -1 as a flag to mean "not known yet" for notification
purposes */ return logical_monitor->in_fullscreen == TRUE;
}
+
+MetaWindow *
+meta_display_get_pointer_window (MetaDisplay *display,
+ MetaWindow *not_this_one)
+{
+ MetaBackend *backend = meta_get_backend ();
+ MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
+ MetaWindow *window;
+ int x, y;
+
+ if (not_this_one)
+ meta_topic (META_DEBUG_FOCUS,
+ "Focusing mouse window excluding %s\n", not_this_one->desc);
+
+ meta_cursor_tracker_get_pointer (cursor_tracker, &x, &y, NULL);
+
+ window = meta_stack_get_default_focus_window_at_point (display->stack,
+ display->screen->active_workspace,
+ not_this_one,
+ x, y);
+
+ return window;
+}
diff --git a/src/core/screen-private.h b/src/core/screen-private.h
index 548271c6a..7b8575d70 100644
--- a/src/core/screen-private.h
+++ b/src/core/screen-private.h
@@ -74,9 +74,6 @@ void meta_screen_free (MetaScreen *scree
void meta_screen_init_workspaces (MetaScreen *screen);
void meta_screen_manage_all_windows (MetaScreen *screen);
-MetaWindow* meta_screen_get_mouse_window (MetaScreen *screen,
- MetaWindow *not_this_one);
-
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 7099e2379..3c107f43a 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -588,29 +588,6 @@ update_num_workspaces (MetaScreen *screen,
g_object_notify (G_OBJECT (screen), "n-workspaces");
}
-MetaWindow*
-meta_screen_get_mouse_window (MetaScreen *screen,
- MetaWindow *not_this_one)
-{
- MetaBackend *backend = meta_get_backend ();
- MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
- MetaWindow *window;
- int x, y;
-
- if (not_this_one)
- meta_topic (META_DEBUG_FOCUS,
- "Focusing mouse window excluding %s\n", not_this_one->desc);
-
- meta_cursor_tracker_get_pointer (cursor_tracker, &x, &y, NULL);
-
- window = meta_stack_get_default_focus_window_at_point (screen->display->stack,
- screen->active_workspace,
- not_this_one,
- x, y);
-
- return window;
-}
-
#define _NET_WM_ORIENTATION_HORZ 0
#define _NET_WM_ORIENTATION_VERT 1
diff --git a/src/core/workspace.c b/src/core/workspace.c
index a4bd148d9..ea036bdc9 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -1274,7 +1274,7 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
else
{
MetaWindow * window;
- window = meta_screen_get_mouse_window (workspace->screen, not_this_one);
+ window = meta_display_get_pointer_window (workspace->screen->display, not_this_one);
if (window &&
window->type != META_WINDOW_DOCK &&
window->type != META_WINDOW_DESKTOP)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]