mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
Move mouse window tracking to MetaDisplay
https://bugzilla.gnome.org/show_bug.cgi?id=759538
This commit is contained in:
parent
82307dd694
commit
6458139c04
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user