Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9504fdd2cb | ||
![]() |
b76c3312e9 | ||
![]() |
fd7db8e6b3 | ||
![]() |
b7840bec7d | ||
![]() |
f743539886 | ||
![]() |
15e01152da | ||
![]() |
2103ff6a5c | ||
![]() |
8ab136b7ea | ||
![]() |
5205821fb9 | ||
![]() |
7187206ef5 | ||
![]() |
96221e6c04 | ||
![]() |
7fdfbad6d4 | ||
![]() |
2a5b068863 | ||
![]() |
0c505faded |
13
NEWS
13
NEWS
@@ -1,3 +1,16 @@
|
||||
3.9.4
|
||||
=====
|
||||
* Tweak window shadows [Allan; #702141]
|
||||
* Ignore our own focus events for focus prediction [Jasper; #701017]
|
||||
* Add API to query if the stage is focused [Jasper; #700735]
|
||||
* Add API to query the monitor for a given position [Adel]
|
||||
* Don't force attached dialogs to be border-only [Florian; #702764]
|
||||
* Allow slicing of backgrounds to avoid texture size limits [Ray; #702283]
|
||||
* Miscellaneous bug fixes and cleanups [Adel; #701224, #702564]
|
||||
|
||||
Contributors:
|
||||
Allan Day, Adel Gadllah, Florian Müllner, Jasper St. Pierre, Ray Strode
|
||||
|
||||
3.9.3
|
||||
=====
|
||||
* Ensure events are always reported to the grab window [Rui; #701219]
|
||||
|
@@ -2,7 +2,7 @@ AC_PREREQ(2.50)
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [9])
|
||||
m4_define([mutter_micro_version], [3])
|
||||
m4_define([mutter_micro_version], [4])
|
||||
|
||||
m4_define([mutter_version],
|
||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||
|
@@ -391,6 +391,24 @@ meta_focus_stage_window (MetaScreen *screen,
|
||||
timestamp);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_stage_is_focused (MetaScreen *screen)
|
||||
{
|
||||
ClutterStage *stage;
|
||||
Window window;
|
||||
|
||||
stage = CLUTTER_STAGE (meta_get_stage_for_screen (screen));
|
||||
if (!stage)
|
||||
return FALSE;
|
||||
|
||||
window = clutter_x11_get_stage_window (stage);
|
||||
|
||||
if (window == None)
|
||||
return FALSE;
|
||||
|
||||
return (screen->display->focus_xwindow == window);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_begin_modal_for_plugin (MetaScreen *screen,
|
||||
MetaPlugin *plugin,
|
||||
@@ -1566,8 +1584,10 @@ void
|
||||
meta_enable_unredirect_for_screen (MetaScreen *screen)
|
||||
{
|
||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||
if (info != NULL)
|
||||
info->disable_unredirect_count = MAX(0, info->disable_unredirect_count - 1);
|
||||
if (info != NULL && info->disable_unredirect_count == 0)
|
||||
g_warning ("Called enable_unredirect_for_screen while unredirection is enabled.");
|
||||
if (info != NULL && info->disable_unredirect_count > 0)
|
||||
info->disable_unredirect_count = info->disable_unredirect_count - 1;
|
||||
}
|
||||
|
||||
#define FLASH_TIME_MS 50
|
||||
|
@@ -1060,7 +1060,7 @@ meta_background_load_file_finish (MetaBackground *self,
|
||||
|
||||
texture = cogl_texture_new_from_data (width,
|
||||
height,
|
||||
COGL_TEXTURE_NO_SLICING,
|
||||
COGL_TEXTURE_NO_ATLAS,
|
||||
has_alpha ?
|
||||
COGL_PIXEL_FORMAT_RGBA_8888 :
|
||||
COGL_PIXEL_FORMAT_RGB_888,
|
||||
|
@@ -123,12 +123,12 @@ static guint signals[LAST_SIGNAL] = { 0 };
|
||||
/* The first element in this array also defines the default parameters
|
||||
* for newly created classes */
|
||||
MetaShadowClassInfo default_shadow_classes[] = {
|
||||
{ "normal", { 6, -1, 0, 3, 255 }, { 3, -1, 0, 3, 128 } },
|
||||
{ "dialog", { 6, -1, 0, 3, 255 }, { 3, -1, 0, 3, 128 } },
|
||||
{ "modal_dialog", { 6, -1, 0, 1, 255 }, { 3, -1, 0, 3, 128 } },
|
||||
{ "utility", { 3, -1, 0, 1, 255 }, { 3, -1, 0, 1, 128 } },
|
||||
{ "border", { 6, -1, 0, 3, 255 }, { 3, -1, 0, 3, 128 } },
|
||||
{ "menu", { 6, -1, 0, 3, 255 }, { 3, -1, 0, 0, 128 } },
|
||||
{ "normal", { 6, -1, 0, 3, 128 }, { 3, -1, 0, 3, 32 } },
|
||||
{ "dialog", { 6, -1, 0, 3, 128 }, { 3, -1, 0, 3, 32 } },
|
||||
{ "modal_dialog", { 6, -1, 0, 1, 128 }, { 3, -1, 0, 3, 32 } },
|
||||
{ "utility", { 3, -1, 0, 1, 128 }, { 3, -1, 0, 1, 32 } },
|
||||
{ "border", { 6, -1, 0, 3, 128 }, { 3, -1, 0, 3, 32 } },
|
||||
{ "menu", { 6, -1, 0, 3, 128 }, { 3, -1, 0, 0, 32 } },
|
||||
|
||||
{ "popup-menu", { 1, -1, 0, 1, 128 }, { 1, -1, 0, 1, 128 } },
|
||||
|
||||
|
@@ -113,6 +113,9 @@ struct _MetaDisplay
|
||||
* or event that caused this.
|
||||
*/
|
||||
MetaWindow *focus_window;
|
||||
/* For windows we've focused that don't necessarily have an X window,
|
||||
* like the no_focus_window or the stage X window. */
|
||||
Window focus_xwindow;
|
||||
gulong focus_serial;
|
||||
|
||||
/* last timestamp passed to XSetInputFocus */
|
||||
|
@@ -1467,6 +1467,17 @@ meta_display_get_current_time (MetaDisplay *display)
|
||||
return display->current_time;
|
||||
}
|
||||
|
||||
static Bool
|
||||
find_timestamp_predicate (Display *xdisplay,
|
||||
XEvent *ev,
|
||||
XPointer arg)
|
||||
{
|
||||
MetaDisplay *display = (MetaDisplay *) arg;
|
||||
|
||||
return (ev->type == PropertyNotify &&
|
||||
ev->xproperty.atom == display->atom__MUTTER_TIMESTAMP_PING);
|
||||
}
|
||||
|
||||
/* Get a timestamp, even if it means a roundtrip */
|
||||
guint32
|
||||
meta_display_get_current_time_roundtrip (MetaDisplay *display)
|
||||
@@ -1478,17 +1489,13 @@ meta_display_get_current_time_roundtrip (MetaDisplay *display)
|
||||
{
|
||||
XEvent property_event;
|
||||
|
||||
/* Using the property XA_PRIMARY because it's safe; nothing
|
||||
* would use it as a property. The type doesn't matter.
|
||||
*/
|
||||
XChangeProperty (display->xdisplay,
|
||||
display->timestamp_pinging_window,
|
||||
XA_PRIMARY, XA_STRING, 8,
|
||||
PropModeAppend, NULL, 0);
|
||||
XWindowEvent (display->xdisplay,
|
||||
display->timestamp_pinging_window,
|
||||
PropertyChangeMask,
|
||||
&property_event);
|
||||
XChangeProperty (display->xdisplay, display->timestamp_pinging_window,
|
||||
display->atom__MUTTER_TIMESTAMP_PING,
|
||||
XA_STRING, 8, PropModeAppend, NULL, 0);
|
||||
XIfEvent (display->xdisplay,
|
||||
&property_event,
|
||||
find_timestamp_predicate,
|
||||
(XPointer) display);
|
||||
timestamp = property_event.xproperty.time;
|
||||
}
|
||||
|
||||
@@ -1876,11 +1883,12 @@ get_input_event (MetaDisplay *display,
|
||||
static void
|
||||
update_focus_window (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
Window xwindow,
|
||||
gulong serial)
|
||||
{
|
||||
display->focus_serial = serial;
|
||||
|
||||
if (window == display->focus_window)
|
||||
if (display->focus_xwindow == xwindow)
|
||||
return;
|
||||
|
||||
if (display->focus_window)
|
||||
@@ -1897,11 +1905,13 @@ update_focus_window (MetaDisplay *display,
|
||||
*/
|
||||
previous = display->focus_window;
|
||||
display->focus_window = NULL;
|
||||
display->focus_xwindow = None;
|
||||
|
||||
meta_window_set_focused_internal (previous, FALSE);
|
||||
}
|
||||
|
||||
display->focus_window = window;
|
||||
display->focus_xwindow = xwindow;
|
||||
|
||||
if (display->focus_window)
|
||||
{
|
||||
@@ -1952,6 +1962,7 @@ request_xserver_input_focus_change (MetaDisplay *display,
|
||||
guint32 timestamp)
|
||||
{
|
||||
MetaWindow *meta_window;
|
||||
gulong serial;
|
||||
|
||||
if (timestamp_too_old (display, ×tamp))
|
||||
return;
|
||||
@@ -1959,14 +1970,35 @@ request_xserver_input_focus_change (MetaDisplay *display,
|
||||
meta_window = meta_display_lookup_x_window (display, xwindow);
|
||||
|
||||
meta_error_trap_push (display);
|
||||
update_focus_window (display,
|
||||
meta_window,
|
||||
XNextRequest (display->xdisplay));
|
||||
|
||||
/* In order for mutter to know that the focus request succeeded, we track
|
||||
* the serial of the "focus request" we made, but if we take the serial
|
||||
* of the XSetInputFocus request, then there's no way to determine the
|
||||
* difference between focus events as a result of the SetInputFocus and
|
||||
* focus events that other clients send around the same time. Ensure that
|
||||
* we know which is which by making two requests that the server will
|
||||
* process at the same time.
|
||||
*/
|
||||
meta_display_grab (display);
|
||||
|
||||
serial = XNextRequest (display->xdisplay);
|
||||
|
||||
XSetInputFocus (display->xdisplay,
|
||||
xwindow,
|
||||
RevertToPointerRoot,
|
||||
timestamp);
|
||||
|
||||
XChangeProperty (display->xdisplay, display->timestamp_pinging_window,
|
||||
display->atom__MUTTER_FOCUS_SET,
|
||||
XA_STRING, 8, PropModeAppend, NULL, 0);
|
||||
|
||||
meta_display_ungrab (display);
|
||||
|
||||
update_focus_window (display,
|
||||
meta_window,
|
||||
xwindow,
|
||||
serial);
|
||||
|
||||
meta_error_trap_pop (display);
|
||||
|
||||
display->last_focus_time = timestamp;
|
||||
@@ -2079,9 +2111,11 @@ handle_window_focus_event (MetaDisplay *display,
|
||||
else
|
||||
g_return_if_reached ();
|
||||
|
||||
if (display->server_focus_serial >= display->focus_serial)
|
||||
if (display->server_focus_serial > display->focus_serial)
|
||||
{
|
||||
update_focus_window (display, focus_window,
|
||||
update_focus_window (display,
|
||||
focus_window,
|
||||
focus_window ? focus_window->xwindow : None,
|
||||
display->server_focus_serial);
|
||||
}
|
||||
}
|
||||
@@ -2137,6 +2171,7 @@ event_callback (XEvent *event,
|
||||
display->focus_window->desc);
|
||||
update_focus_window (display,
|
||||
meta_display_lookup_x_window (display, display->server_focus_window),
|
||||
display->server_focus_window,
|
||||
display->server_focus_serial);
|
||||
}
|
||||
|
||||
|
@@ -187,6 +187,9 @@ MetaWindow* meta_screen_get_mouse_window (MetaScreen *scre
|
||||
MetaWindow *not_this_one);
|
||||
|
||||
const MetaMonitorInfo* meta_screen_get_current_monitor_info (MetaScreen *screen);
|
||||
const MetaMonitorInfo* meta_screen_get_current_monitor_info_for_pos (MetaScreen *screen,
|
||||
int x,
|
||||
int y);
|
||||
const MetaMonitorInfo* meta_screen_get_monitor_for_rect (MetaScreen *screen,
|
||||
MetaRectangle *rect);
|
||||
const MetaMonitorInfo* meta_screen_get_monitor_for_window (MetaScreen *screen,
|
||||
|
@@ -2216,6 +2216,65 @@ meta_screen_get_current_monitor_info (MetaScreen *screen)
|
||||
return &screen->monitor_infos[monitor_index];
|
||||
}
|
||||
|
||||
const MetaMonitorInfo*
|
||||
meta_screen_get_current_monitor_info_for_pos (MetaScreen *screen,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
int monitor_index;
|
||||
monitor_index = meta_screen_get_current_monitor_for_pos (screen, x, y);
|
||||
return &screen->monitor_infos[monitor_index];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* meta_screen_get_current_monitor_for_pos:
|
||||
* @screen: a #MetaScreen
|
||||
* @x: The x coordinate
|
||||
* @y: The y coordinate
|
||||
*
|
||||
* Gets the index of the monitor that contains the passed coordinates.
|
||||
*
|
||||
* Return value: a monitor index
|
||||
*/
|
||||
int
|
||||
meta_screen_get_current_monitor_for_pos (MetaScreen *screen,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
if (screen->n_monitor_infos == 1)
|
||||
return 0;
|
||||
else if (screen->display->monitor_cache_invalidated)
|
||||
{
|
||||
int i;
|
||||
MetaRectangle pointer_position;
|
||||
pointer_position.x = x;
|
||||
pointer_position.y = y;
|
||||
pointer_position.width = pointer_position.height = 1;
|
||||
|
||||
screen->display->monitor_cache_invalidated = FALSE;
|
||||
screen->last_monitor_index = 0;
|
||||
|
||||
for (i = 0; i < screen->n_monitor_infos; i++)
|
||||
{
|
||||
if (meta_rectangle_contains_rect (&screen->monitor_infos[i].rect,
|
||||
&pointer_position))
|
||||
{
|
||||
screen->last_monitor_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
meta_topic (META_DEBUG_XINERAMA,
|
||||
"Rechecked current monitor, now %d\n",
|
||||
screen->last_monitor_index);
|
||||
|
||||
}
|
||||
|
||||
return screen->last_monitor_index;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* meta_screen_get_current_monitor:
|
||||
* @screen: a #MetaScreen
|
||||
@@ -2241,11 +2300,7 @@ meta_screen_get_current_monitor (MetaScreen *screen)
|
||||
XIButtonState buttons;
|
||||
XIModifierState mods;
|
||||
XIGroupState group;
|
||||
int i;
|
||||
MetaRectangle pointer_position;
|
||||
|
||||
screen->display->monitor_cache_invalidated = FALSE;
|
||||
|
||||
XIQueryPointer (screen->display->xdisplay,
|
||||
META_VIRTUAL_CORE_POINTER_ID,
|
||||
screen->xroot,
|
||||
@@ -2260,24 +2315,7 @@ meta_screen_get_current_monitor (MetaScreen *screen)
|
||||
&group);
|
||||
free (buttons.mask);
|
||||
|
||||
pointer_position.x = root_x_return;
|
||||
pointer_position.y = root_y_return;
|
||||
pointer_position.width = pointer_position.height = 1;
|
||||
|
||||
screen->last_monitor_index = 0;
|
||||
for (i = 0; i < screen->n_monitor_infos; i++)
|
||||
{
|
||||
if (meta_rectangle_contains_rect (&screen->monitor_infos[i].rect,
|
||||
&pointer_position))
|
||||
{
|
||||
screen->last_monitor_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
meta_topic (META_DEBUG_XINERAMA,
|
||||
"Rechecked current monitor, now %d\n",
|
||||
screen->last_monitor_index);
|
||||
meta_screen_get_current_monitor_for_pos (screen, root_x_return, root_y_return);
|
||||
}
|
||||
|
||||
return screen->last_monitor_index;
|
||||
@@ -3001,7 +3039,7 @@ meta_screen_resize (MetaScreen *screen,
|
||||
|
||||
/* Fix up monitor for all windows on this screen */
|
||||
windows = meta_display_list_windows (screen->display,
|
||||
META_LIST_DEFAULT);
|
||||
META_LIST_INCLUDE_OVERRIDE_REDIRECT);
|
||||
for (tmp = windows; tmp != NULL; tmp = tmp->next)
|
||||
{
|
||||
MetaWindow *window = tmp->data;
|
||||
|
@@ -145,6 +145,8 @@ static void meta_window_move_between_rects (MetaWindow *window,
|
||||
static void unmaximize_window_before_freeing (MetaWindow *window);
|
||||
static void unminimize_window_and_all_transient_parents (MetaWindow *window);
|
||||
|
||||
static void meta_window_update_monitor (MetaWindow *window);
|
||||
|
||||
/* Idle handlers for the three queues (run with meta_later_add()). The
|
||||
* "data" parameter in each case will be a GINT_TO_POINTER of the
|
||||
* index into the queue arrays to use.
|
||||
@@ -4767,6 +4769,12 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
|
||||
if (window->type == META_WINDOW_DESKTOP)
|
||||
return;
|
||||
|
||||
if (window->override_redirect)
|
||||
{
|
||||
meta_window_update_monitor (window);
|
||||
return;
|
||||
}
|
||||
|
||||
old = window->monitor;
|
||||
|
||||
/* Start on primary */
|
||||
@@ -8243,9 +8251,6 @@ recalc_window_features (MetaWindow *window)
|
||||
if (window->type == META_WINDOW_TOOLBAR)
|
||||
window->decorated = FALSE;
|
||||
|
||||
if (meta_window_is_attached_dialog (window))
|
||||
window->border_only = TRUE;
|
||||
|
||||
if (window->type == META_WINDOW_DESKTOP ||
|
||||
window->type == META_WINDOW_DOCK ||
|
||||
window->override_redirect)
|
||||
@@ -8916,7 +8921,7 @@ update_move (MetaWindow *window,
|
||||
* refers to the monitor which contains the largest part of the window,
|
||||
* the latter to the one where the pointer is located.
|
||||
*/
|
||||
monitor = meta_screen_get_current_monitor_info (window->screen);
|
||||
monitor = meta_screen_get_current_monitor_info_for_pos (window->screen, x, y);
|
||||
meta_window_get_work_area_for_monitor (window,
|
||||
monitor->number,
|
||||
&work_area);
|
||||
@@ -10978,7 +10983,7 @@ meta_window_get_frame_type (MetaWindow *window)
|
||||
/* can't add border if undecorated */
|
||||
return META_FRAME_TYPE_LAST;
|
||||
}
|
||||
else if ((window->border_only && base_type != META_FRAME_TYPE_ATTACHED) ||
|
||||
else if (window->border_only ||
|
||||
(window->hide_titlebar_when_maximized && META_WINDOW_MAXIMIZED (window)) ||
|
||||
(window->hide_titlebar_when_maximized && META_WINDOW_TILED_SIDE_BY_SIDE (window)))
|
||||
{
|
||||
|
@@ -70,6 +70,8 @@ item(_GNOME_WM_KEYBINDINGS)
|
||||
item(_GNOME_PANEL_ACTION)
|
||||
item(_GNOME_PANEL_ACTION_MAIN_MENU)
|
||||
item(_GNOME_PANEL_ACTION_RUN_DIALOG)
|
||||
item(_MUTTER_TIMESTAMP_PING)
|
||||
item(_MUTTER_FOCUS_SET)
|
||||
item(_MUTTER_SENTINEL)
|
||||
item(_MUTTER_VERSION)
|
||||
item(WM_CLIENT_MACHINE)
|
||||
|
@@ -48,5 +48,6 @@ void meta_set_stage_input_region (MetaScreen *screen,
|
||||
void meta_empty_stage_input_region (MetaScreen *screen);
|
||||
void meta_focus_stage_window (MetaScreen *screen,
|
||||
guint32 timestamp);
|
||||
gboolean meta_stage_is_focused (MetaScreen *screen);
|
||||
|
||||
#endif
|
||||
|
@@ -78,6 +78,9 @@ MetaWorkspace * meta_screen_get_active_workspace (MetaScreen *screen);
|
||||
int meta_screen_get_n_monitors (MetaScreen *screen);
|
||||
int meta_screen_get_primary_monitor (MetaScreen *screen);
|
||||
int meta_screen_get_current_monitor (MetaScreen *screen);
|
||||
int meta_screen_get_current_monitor_for_pos (MetaScreen *screen,
|
||||
int x,
|
||||
int y);
|
||||
void meta_screen_get_monitor_geometry (MetaScreen *screen,
|
||||
int monitor,
|
||||
MetaRectangle *geometry);
|
||||
|
Reference in New Issue
Block a user