mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
Oops, I only meant to commit the changes to rationales.txt in the last commit
This commit is contained in:
parent
7e821f37fd
commit
53cba6ed37
@ -461,6 +461,7 @@ meta_display_open (const char *name)
|
|||||||
* created in screen_new
|
* created in screen_new
|
||||||
*/
|
*/
|
||||||
display->leader_window = None;
|
display->leader_window = None;
|
||||||
|
display->no_focus_window = None;
|
||||||
|
|
||||||
display->xinerama_cache_invalidated = TRUE;
|
display->xinerama_cache_invalidated = TRUE;
|
||||||
|
|
||||||
@ -711,10 +712,7 @@ meta_display_open (const char *name)
|
|||||||
* as it is the most recent timestamp.
|
* as it is the most recent timestamp.
|
||||||
*/
|
*/
|
||||||
if (focus == None || focus == PointerRoot)
|
if (focus == None || focus == PointerRoot)
|
||||||
/* Just focus the no_focus_window on the first screen */
|
meta_display_focus_the_no_focus_window (display, timestamp);
|
||||||
meta_display_focus_the_no_focus_window (display,
|
|
||||||
display->screens->data,
|
|
||||||
timestamp);
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MetaWindow * window;
|
MetaWindow * window;
|
||||||
@ -722,10 +720,7 @@ meta_display_open (const char *name)
|
|||||||
if (window)
|
if (window)
|
||||||
meta_display_set_input_focus_window (display, window, FALSE, timestamp);
|
meta_display_set_input_focus_window (display, window, FALSE, timestamp);
|
||||||
else
|
else
|
||||||
/* Just focus the no_focus_window on the first screen */
|
meta_display_focus_the_no_focus_window (display, timestamp);
|
||||||
meta_display_focus_the_no_focus_window (display,
|
|
||||||
display->screens->data,
|
|
||||||
timestamp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_error_trap_pop (display, FALSE);
|
meta_error_trap_pop (display, FALSE);
|
||||||
@ -1875,7 +1870,6 @@ event_callback (XEvent *event,
|
|||||||
"Unsetting focus from %s due to LeaveNotify\n",
|
"Unsetting focus from %s due to LeaveNotify\n",
|
||||||
window->desc);
|
window->desc);
|
||||||
meta_display_focus_the_no_focus_window (display,
|
meta_display_focus_the_no_focus_window (display,
|
||||||
window->screen,
|
|
||||||
event->xcrossing.time);
|
event->xcrossing.time);
|
||||||
}
|
}
|
||||||
if (window->type != META_WINDOW_DOCK &&
|
if (window->type != META_WINDOW_DOCK &&
|
||||||
@ -1907,8 +1901,7 @@ event_callback (XEvent *event,
|
|||||||
{
|
{
|
||||||
meta_window_notify_focus (window, event);
|
meta_window_notify_focus (window, event);
|
||||||
}
|
}
|
||||||
else if (meta_display_xwindow_is_a_no_focus_window (display,
|
else if (event->xany.window == display->no_focus_window)
|
||||||
event->xany.window))
|
|
||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_FOCUS,
|
meta_topic (META_DEBUG_FOCUS,
|
||||||
"Focus %s event received on no_focus_window 0x%lx "
|
"Focus %s event received on no_focus_window 0x%lx "
|
||||||
@ -2998,24 +2991,6 @@ meta_display_unregister_x_window (MetaDisplay *display,
|
|||||||
remove_pending_pings_for_window (display, xwindow);
|
remove_pending_pings_for_window (display, xwindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
meta_display_xwindow_is_a_no_focus_window (MetaDisplay *display,
|
|
||||||
Window xwindow)
|
|
||||||
{
|
|
||||||
gboolean is_a_no_focus_window = FALSE;
|
|
||||||
GSList *temp = display->screens;
|
|
||||||
while (temp != NULL) {
|
|
||||||
MetaScreen *screen = temp->data;
|
|
||||||
if (screen->no_focus_window == xwindow) {
|
|
||||||
is_a_no_focus_window = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
temp = temp->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return is_a_no_focus_window;
|
|
||||||
}
|
|
||||||
|
|
||||||
Cursor
|
Cursor
|
||||||
meta_display_create_x_cursor (MetaDisplay *display,
|
meta_display_create_x_cursor (MetaDisplay *display,
|
||||||
MetaCursor cursor)
|
MetaCursor cursor)
|
||||||
@ -4846,14 +4821,13 @@ meta_display_set_input_focus_window (MetaDisplay *display,
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_display_focus_the_no_focus_window (MetaDisplay *display,
|
meta_display_focus_the_no_focus_window (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
Time timestamp)
|
Time timestamp)
|
||||||
{
|
{
|
||||||
if (timestamp_too_old (display, NULL, ×tamp))
|
if (timestamp_too_old (display, NULL, ×tamp))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
XSetInputFocus (display->xdisplay,
|
XSetInputFocus (display->xdisplay,
|
||||||
screen->no_focus_window,
|
display->no_focus_window,
|
||||||
RevertToPointerRoot,
|
RevertToPointerRoot,
|
||||||
timestamp);
|
timestamp);
|
||||||
display->expected_focus_window = NULL;
|
display->expected_focus_window = NULL;
|
||||||
|
@ -216,6 +216,11 @@ struct _MetaDisplay
|
|||||||
XErrorEvent *error);
|
XErrorEvent *error);
|
||||||
int server_grab_count;
|
int server_grab_count;
|
||||||
|
|
||||||
|
/* This window holds the focus when we don't want to focus
|
||||||
|
* any actual clients
|
||||||
|
*/
|
||||||
|
Window no_focus_window;
|
||||||
|
|
||||||
/* for double click */
|
/* for double click */
|
||||||
Time last_button_time;
|
Time last_button_time;
|
||||||
Window last_button_xwindow;
|
Window last_button_xwindow;
|
||||||
@ -408,9 +413,6 @@ void meta_display_register_x_window (MetaDisplay *display,
|
|||||||
MetaWindow *window);
|
MetaWindow *window);
|
||||||
void meta_display_unregister_x_window (MetaDisplay *display,
|
void meta_display_unregister_x_window (MetaDisplay *display,
|
||||||
Window xwindow);
|
Window xwindow);
|
||||||
/* Return whether the xwindow is a no focus window for any of the screens */
|
|
||||||
gboolean meta_display_xwindow_is_a_no_focus_window (MetaDisplay *display,
|
|
||||||
Window xwindow);
|
|
||||||
|
|
||||||
GSList* meta_display_list_windows (MetaDisplay *display);
|
GSList* meta_display_list_windows (MetaDisplay *display);
|
||||||
|
|
||||||
@ -537,7 +539,6 @@ void meta_display_set_input_focus_window (MetaDisplay *display,
|
|||||||
* same as meta_display_set_input_focus_window
|
* same as meta_display_set_input_focus_window
|
||||||
*/
|
*/
|
||||||
void meta_display_focus_the_no_focus_window (MetaDisplay *display,
|
void meta_display_focus_the_no_focus_window (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
Time timestamp);
|
Time timestamp);
|
||||||
|
|
||||||
void meta_display_queue_autoraise_callback (MetaDisplay *display,
|
void meta_display_queue_autoraise_callback (MetaDisplay *display,
|
||||||
|
@ -1451,15 +1451,11 @@ primary_modifier_still_pressed (MetaDisplay *display,
|
|||||||
int x, y, root_x, root_y;
|
int x, y, root_x, root_y;
|
||||||
Window root, child;
|
Window root, child;
|
||||||
guint mask;
|
guint mask;
|
||||||
MetaScreen *random_screen;
|
|
||||||
Window random_xwindow;
|
|
||||||
|
|
||||||
primary_modifier = get_primary_modifier (display, entire_binding_mask);
|
primary_modifier = get_primary_modifier (display, entire_binding_mask);
|
||||||
|
|
||||||
random_screen = display->screens->data;
|
|
||||||
random_xwindow = random_screen->no_focus_window;
|
|
||||||
XQueryPointer (display->xdisplay,
|
XQueryPointer (display->xdisplay,
|
||||||
random_xwindow, /* some random window */
|
display->no_focus_window, /* some random window */
|
||||||
&root, &child,
|
&root, &child,
|
||||||
&root_x, &root_y,
|
&root_x, &root_y,
|
||||||
&x, &y,
|
&x, &y,
|
||||||
|
16
src/screen.c
16
src/screen.c
@ -578,13 +578,15 @@ meta_screen_new (MetaDisplay *display,
|
|||||||
|
|
||||||
meta_screen_set_cursor (screen, META_CURSOR_DEFAULT);
|
meta_screen_set_cursor (screen, META_CURSOR_DEFAULT);
|
||||||
|
|
||||||
/* Handle creating a no_focus_window for this screen */
|
if (display->no_focus_window == None)
|
||||||
screen->no_focus_window = meta_create_offscreen_window (display->xdisplay,
|
{
|
||||||
screen->xroot);
|
display->no_focus_window = meta_create_offscreen_window (display->xdisplay,
|
||||||
XSelectInput (display->xdisplay, screen->no_focus_window,
|
screen->xroot);
|
||||||
FocusChangeMask | KeyPressMask | KeyReleaseMask);
|
|
||||||
XMapWindow (display->xdisplay, screen->no_focus_window);
|
XSelectInput (display->xdisplay, display->no_focus_window,
|
||||||
/* Done with no_focus_window stuff */
|
FocusChangeMask | KeyPressMask | KeyReleaseMask);
|
||||||
|
XMapWindow (display->xdisplay, display->no_focus_window);
|
||||||
|
}
|
||||||
|
|
||||||
set_wm_icon_size_hint (screen);
|
set_wm_icon_size_hint (screen);
|
||||||
|
|
||||||
|
@ -72,11 +72,6 @@ struct _MetaScreen
|
|||||||
|
|
||||||
MetaWorkspace *active_workspace;
|
MetaWorkspace *active_workspace;
|
||||||
|
|
||||||
/* This window holds the focus when we don't want to focus
|
|
||||||
* any actual clients
|
|
||||||
*/
|
|
||||||
Window no_focus_window;
|
|
||||||
|
|
||||||
GList *workspaces;
|
GList *workspaces;
|
||||||
|
|
||||||
MetaStack *stack;
|
MetaStack *stack;
|
||||||
|
@ -241,7 +241,7 @@ meta_window_new_with_attrs (MetaDisplay *display,
|
|||||||
|
|
||||||
meta_verbose ("Attempting to manage 0x%lx\n", xwindow);
|
meta_verbose ("Attempting to manage 0x%lx\n", xwindow);
|
||||||
|
|
||||||
if (meta_display_xwindow_is_a_no_focus_window (display, xwindow))
|
if (xwindow == display->no_focus_window)
|
||||||
{
|
{
|
||||||
meta_verbose ("Not managing no_focus_window 0x%lx\n",
|
meta_verbose ("Not managing no_focus_window 0x%lx\n",
|
||||||
xwindow);
|
xwindow);
|
||||||
@ -1763,7 +1763,7 @@ meta_window_show (MetaWindow *window)
|
|||||||
"ancestor.\n",
|
"ancestor.\n",
|
||||||
window->display->focus_window->desc, window->desc);
|
window->display->focus_window->desc, window->desc);
|
||||||
|
|
||||||
meta_display_focus_the_no_focus_window (window->display, window->screen, meta_display_get_current_time_roundtrip (window->display));
|
meta_display_focus_the_no_focus_window (window->display, meta_display_get_current_time_roundtrip (window->display));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -925,7 +925,6 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
|
|||||||
"Setting focus to no_focus_window, since no valid "
|
"Setting focus to no_focus_window, since no valid "
|
||||||
"window to focus found.\n");
|
"window to focus found.\n");
|
||||||
meta_display_focus_the_no_focus_window (workspace->screen->display,
|
meta_display_focus_the_no_focus_window (workspace->screen->display,
|
||||||
workspace->screen,
|
|
||||||
timestamp);
|
timestamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1015,7 +1014,6 @@ focus_ancestor_or_mru_window (MetaWorkspace *workspace,
|
|||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_FOCUS, "No MRU window to focus found; focusing no_focus_window.\n");
|
meta_topic (META_DEBUG_FOCUS, "No MRU window to focus found; focusing no_focus_window.\n");
|
||||||
meta_display_focus_the_no_focus_window (workspace->screen->display,
|
meta_display_focus_the_no_focus_window (workspace->screen->display,
|
||||||
workspace->screen,
|
|
||||||
timestamp);
|
timestamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user