Compare commits
1 Commits
wip/resize
...
wip/resize
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ffe7b5e7d8 |
14
NEWS
14
NEWS
@@ -1,17 +1,3 @@
|
|||||||
3.11.91
|
|
||||||
=======
|
|
||||||
* Don't use keysym to match keybindings [Rui; #678001]
|
|
||||||
* Fix message tray icons showing up blank (again) [Adel; #725180]
|
|
||||||
* Improve keybinding lookups [Rui; #725588]
|
|
||||||
* Fix dynamic updates of titlebar style properties [Owen; #725751]
|
|
||||||
* Fix positioning of manually positioned windows [Owen; #724049]
|
|
||||||
* Misc bug fixes and cleanups [Jasper, Carlos, Adel, Giovanni, Florian; #720631,
|
|
||||||
#724969, #725216, #724402, #722266, #725338, #725525]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Giovanni Campagna, Adel Gadllah, Carlos Garnacho, Rui Matos, Florian Müllner,
|
|
||||||
Jasper St. Pierre, Owen W. Taylor
|
|
||||||
|
|
||||||
3.11.90
|
3.11.90
|
||||||
=======
|
=======
|
||||||
* Fix double-scaling on high DPI resolutions [Adel; #723931]
|
* Fix double-scaling on high DPI resolutions [Adel; #723931]
|
||||||
|
@@ -3,7 +3,7 @@ AC_CONFIG_MACRO_DIR([m4])
|
|||||||
|
|
||||||
m4_define([mutter_major_version], [3])
|
m4_define([mutter_major_version], [3])
|
||||||
m4_define([mutter_minor_version], [11])
|
m4_define([mutter_minor_version], [11])
|
||||||
m4_define([mutter_micro_version], [91])
|
m4_define([mutter_micro_version], [90])
|
||||||
|
|
||||||
m4_define([mutter_version],
|
m4_define([mutter_version],
|
||||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||||
|
@@ -491,17 +491,12 @@ place_window_if_needed(MetaWindow *window,
|
|||||||
!window->minimized &&
|
!window->minimized &&
|
||||||
!window->fullscreen)
|
!window->fullscreen)
|
||||||
{
|
{
|
||||||
MetaRectangle orig_rect;
|
|
||||||
MetaRectangle placed_rect;
|
MetaRectangle placed_rect;
|
||||||
MetaWorkspace *cur_workspace;
|
MetaWorkspace *cur_workspace;
|
||||||
const MetaMonitorInfo *monitor_info;
|
const MetaMonitorInfo *monitor_info;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &placed_rect);
|
meta_window_get_frame_rect (window, &placed_rect);
|
||||||
|
meta_window_place (window, info->orig.x, info->orig.y,
|
||||||
orig_rect = info->orig;
|
|
||||||
extend_by_frame (window, &orig_rect);
|
|
||||||
|
|
||||||
meta_window_place (window, orig_rect.x, orig_rect.y,
|
|
||||||
&placed_rect.x, &placed_rect.y);
|
&placed_rect.x, &placed_rect.y);
|
||||||
did_placement = TRUE;
|
did_placement = TRUE;
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#define _XOPEN_SOURCE /* for putenv() and some signal-related functions */
|
#define _SVID_SOURCE /* for putenv() and some signal-related functions */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <meta/main.h>
|
#include <meta/main.h>
|
||||||
|
@@ -1074,10 +1074,9 @@ get_pointer_position_gdk (int *x,
|
|||||||
GdkScreen *gscreen;
|
GdkScreen *gscreen;
|
||||||
|
|
||||||
gmanager = gdk_display_get_device_manager (gdk_display_get_default ());
|
gmanager = gdk_display_get_device_manager (gdk_display_get_default ());
|
||||||
gdevice = gdk_x11_device_manager_lookup (gmanager, META_VIRTUAL_CORE_POINTER_ID);
|
gdevice = gdk_device_manager_get_client_pointer (gmanager);
|
||||||
|
|
||||||
gdk_device_get_position (gdevice, &gscreen, x, y);
|
gdk_device_get_position (gdevice, &gscreen, x, y);
|
||||||
if (mods)
|
|
||||||
gdk_device_get_state (gdevice,
|
gdk_device_get_state (gdevice,
|
||||||
gdk_screen_get_root_window (gscreen),
|
gdk_screen_get_root_window (gscreen),
|
||||||
NULL, (GdkModifierType*)mods);
|
NULL, (GdkModifierType*)mods);
|
||||||
@@ -1096,11 +1095,8 @@ get_pointer_position_clutter (int *x,
|
|||||||
cdevice = clutter_device_manager_get_core_device (cmanager, CLUTTER_POINTER_DEVICE);
|
cdevice = clutter_device_manager_get_core_device (cmanager, CLUTTER_POINTER_DEVICE);
|
||||||
|
|
||||||
clutter_input_device_get_coords (cdevice, NULL, &point);
|
clutter_input_device_get_coords (cdevice, NULL, &point);
|
||||||
if (x)
|
|
||||||
*x = point.x;
|
*x = point.x;
|
||||||
if (y)
|
|
||||||
*y = point.y;
|
*y = point.y;
|
||||||
if (mods)
|
|
||||||
*mods = clutter_input_device_get_modifier_state (cdevice);
|
*mods = clutter_input_device_get_modifier_state (cdevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1514,19 +1514,38 @@ meta_screen_get_mouse_window (MetaScreen *screen,
|
|||||||
MetaWindow *not_this_one)
|
MetaWindow *not_this_one)
|
||||||
{
|
{
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
int x, y;
|
Window root_return, child_return;
|
||||||
|
double root_x_return, root_y_return;
|
||||||
|
double win_x_return, win_y_return;
|
||||||
|
XIButtonState buttons;
|
||||||
|
XIModifierState mods;
|
||||||
|
XIGroupState group;
|
||||||
|
|
||||||
if (not_this_one)
|
if (not_this_one)
|
||||||
meta_topic (META_DEBUG_FOCUS,
|
meta_topic (META_DEBUG_FOCUS,
|
||||||
"Focusing mouse window excluding %s\n", not_this_one->desc);
|
"Focusing mouse window excluding %s\n", not_this_one->desc);
|
||||||
|
|
||||||
meta_cursor_tracker_get_pointer (screen->cursor_tracker,
|
meta_error_trap_push (screen->display);
|
||||||
&x, &y, NULL);
|
XIQueryPointer (screen->display->xdisplay,
|
||||||
|
META_VIRTUAL_CORE_POINTER_ID,
|
||||||
|
screen->xroot,
|
||||||
|
&root_return,
|
||||||
|
&child_return,
|
||||||
|
&root_x_return,
|
||||||
|
&root_y_return,
|
||||||
|
&win_x_return,
|
||||||
|
&win_y_return,
|
||||||
|
&buttons,
|
||||||
|
&mods,
|
||||||
|
&group);
|
||||||
|
meta_error_trap_pop (screen->display);
|
||||||
|
free (buttons.mask);
|
||||||
|
|
||||||
window = meta_stack_get_default_focus_window_at_point (screen->stack,
|
window = meta_stack_get_default_focus_window_at_point (screen->stack,
|
||||||
screen->active_workspace,
|
screen->active_workspace,
|
||||||
not_this_one,
|
not_this_one,
|
||||||
x, y);
|
root_x_return,
|
||||||
|
root_y_return);
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
@@ -1808,11 +1827,28 @@ meta_screen_get_current_monitor (MetaScreen *screen)
|
|||||||
|
|
||||||
if (screen->display->monitor_cache_invalidated)
|
if (screen->display->monitor_cache_invalidated)
|
||||||
{
|
{
|
||||||
int x, y;
|
Window root_return, child_return;
|
||||||
|
double win_x_return, win_y_return;
|
||||||
|
double root_x_return, root_y_return;
|
||||||
|
XIButtonState buttons;
|
||||||
|
XIModifierState mods;
|
||||||
|
XIGroupState group;
|
||||||
|
|
||||||
meta_cursor_tracker_get_pointer (screen->cursor_tracker,
|
XIQueryPointer (screen->display->xdisplay,
|
||||||
&x, &y, NULL);
|
META_VIRTUAL_CORE_POINTER_ID,
|
||||||
meta_screen_get_current_monitor_for_pos (screen, x, y);
|
screen->xroot,
|
||||||
|
&root_return,
|
||||||
|
&child_return,
|
||||||
|
&root_x_return,
|
||||||
|
&root_y_return,
|
||||||
|
&win_x_return,
|
||||||
|
&win_y_return,
|
||||||
|
&buttons,
|
||||||
|
&mods,
|
||||||
|
&group);
|
||||||
|
free (buttons.mask);
|
||||||
|
|
||||||
|
meta_screen_get_current_monitor_for_pos (screen, root_x_return, root_y_return);
|
||||||
}
|
}
|
||||||
|
|
||||||
return screen->last_monitor_index;
|
return screen->last_monitor_index;
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#define _XOPEN_SOURCE 500 /* for gethostname() */
|
#define _SVID_SOURCE /* for gethostname() */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "window-props.h"
|
#include "window-props.h"
|
||||||
|
@@ -38,7 +38,6 @@
|
|||||||
#include <meta/common.h>
|
#include <meta/common.h>
|
||||||
#include <meta/errors.h>
|
#include <meta/errors.h>
|
||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
#include <meta/meta-cursor-tracker.h>
|
|
||||||
|
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
#include "window-props.h"
|
#include "window-props.h"
|
||||||
@@ -674,19 +673,35 @@ meta_window_x11_property_notify (MetaWindow *window,
|
|||||||
static int
|
static int
|
||||||
query_pressed_buttons (MetaWindow *window)
|
query_pressed_buttons (MetaWindow *window)
|
||||||
{
|
{
|
||||||
ClutterModifierType mods;
|
double x, y, query_root_x, query_root_y;
|
||||||
|
Window root, child;
|
||||||
|
XIButtonState buttons;
|
||||||
|
XIModifierState mods;
|
||||||
|
XIGroupState group;
|
||||||
int button = 0;
|
int button = 0;
|
||||||
|
|
||||||
meta_cursor_tracker_get_pointer (window->screen->cursor_tracker,
|
meta_error_trap_push (window->display);
|
||||||
NULL, NULL, &mods);
|
XIQueryPointer (window->display->xdisplay,
|
||||||
|
META_VIRTUAL_CORE_POINTER_ID,
|
||||||
|
window->xwindow,
|
||||||
|
&root, &child,
|
||||||
|
&query_root_x, &query_root_y,
|
||||||
|
&x, &y,
|
||||||
|
&buttons, &mods, &group);
|
||||||
|
|
||||||
if (mods & CLUTTER_BUTTON1_MASK)
|
if (meta_error_trap_pop_with_return (window->display) != Success)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
if (XIMaskIsSet (buttons.mask, Button1))
|
||||||
button |= 1 << 1;
|
button |= 1 << 1;
|
||||||
if (mods & CLUTTER_BUTTON2_MASK)
|
if (XIMaskIsSet (buttons.mask, Button2))
|
||||||
button |= 1 << 2;
|
button |= 1 << 2;
|
||||||
if (mods & CLUTTER_BUTTON3_MASK)
|
if (XIMaskIsSet (buttons.mask, Button3))
|
||||||
button |= 1 << 3;
|
button |= 1 << 3;
|
||||||
|
|
||||||
|
free (buttons.mask);
|
||||||
|
|
||||||
|
out:
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -86,9 +86,8 @@ static void meta_window_show (MetaWindow *window);
|
|||||||
static void meta_window_hide (MetaWindow *window);
|
static void meta_window_hide (MetaWindow *window);
|
||||||
|
|
||||||
static void meta_window_save_rect (MetaWindow *window);
|
static void meta_window_save_rect (MetaWindow *window);
|
||||||
static void save_user_window_placement (MetaWindow *window,
|
static void save_user_window_placement (MetaWindow *window);
|
||||||
MetaRectangle *rect,
|
static void force_save_user_window_placement (MetaWindow *window);
|
||||||
gboolean force);
|
|
||||||
|
|
||||||
static void meta_window_move_resize_internal (MetaWindow *window,
|
static void meta_window_move_resize_internal (MetaWindow *window,
|
||||||
MetaMoveResizeFlags flags,
|
MetaMoveResizeFlags flags,
|
||||||
@@ -3042,39 +3041,42 @@ meta_window_save_rect (MetaWindow *window)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* save_user_window_placement:
|
* force_save_user_window_placement:
|
||||||
* @window: Store current position of this window for future reference
|
* @window: Store current position of this window for future reference
|
||||||
* @rect: the rectangle with the position we want (in case it's not yet
|
*
|
||||||
* assumed by the window, which happens for wayland resizes), or
|
* Save the user_rect regardless of whether the window is maximized or
|
||||||
* %NULL to use the current window position
|
* fullscreen. See save_user_window_placement() for most uses.
|
||||||
* @force: save the user_rect regardless of whether the window is maximized or
|
|
||||||
* fullscreen
|
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
save_user_window_placement (MetaWindow *window,
|
force_save_user_window_placement (MetaWindow *window)
|
||||||
MetaRectangle *rect,
|
|
||||||
gboolean force)
|
|
||||||
{
|
{
|
||||||
gboolean should_save = !META_WINDOW_MAXIMIZED (window) &&
|
meta_window_get_client_root_coords (window, &window->user_rect);
|
||||||
!META_WINDOW_TILED_SIDE_BY_SIDE (window) &&
|
}
|
||||||
!window->fullscreen;
|
|
||||||
|
|
||||||
if (force || should_save)
|
/**
|
||||||
|
* save_user_window_placement:
|
||||||
|
* @window: Store current position of this window for future reference
|
||||||
|
*
|
||||||
|
* Save the user_rect, but only if the window is neither maximized nor
|
||||||
|
* fullscreen, otherwise the window may snap back to those dimensions
|
||||||
|
* (bug #461927).
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
save_user_window_placement (MetaWindow *window)
|
||||||
|
{
|
||||||
|
if (!(META_WINDOW_MAXIMIZED (window) || META_WINDOW_TILED_SIDE_BY_SIDE (window) || window->fullscreen))
|
||||||
{
|
{
|
||||||
MetaRectangle user_rect;
|
MetaRectangle user_rect;
|
||||||
|
|
||||||
if (rect)
|
|
||||||
user_rect = *rect;
|
|
||||||
else
|
|
||||||
meta_window_get_client_root_coords (window, &user_rect);
|
meta_window_get_client_root_coords (window, &user_rect);
|
||||||
|
|
||||||
if (force || !window->maximized_horizontally)
|
if (!window->maximized_horizontally)
|
||||||
{
|
{
|
||||||
window->user_rect.x = user_rect.x;
|
window->user_rect.x = user_rect.x;
|
||||||
window->user_rect.width = user_rect.width;
|
window->user_rect.width = user_rect.width;
|
||||||
}
|
}
|
||||||
if (force || !window->maximized_vertically)
|
if (!window->maximized_vertically)
|
||||||
{
|
{
|
||||||
window->user_rect.y = user_rect.y;
|
window->user_rect.y = user_rect.y;
|
||||||
window->user_rect.height = user_rect.height;
|
window->user_rect.height = user_rect.height;
|
||||||
@@ -3584,7 +3586,7 @@ meta_window_unmaximize_internal (MetaWindow *window,
|
|||||||
|
|
||||||
/* Make sure user_rect is current.
|
/* Make sure user_rect is current.
|
||||||
*/
|
*/
|
||||||
save_user_window_placement (window, NULL, TRUE);
|
force_save_user_window_placement (window);
|
||||||
|
|
||||||
/* When we unmaximize, if we're doing a mouse move also we could
|
/* When we unmaximize, if we're doing a mouse move also we could
|
||||||
* get the window suddenly jumping to the upper left corner of
|
* get the window suddenly jumping to the upper left corner of
|
||||||
@@ -3761,7 +3763,7 @@ meta_window_unmake_fullscreen (MetaWindow *window)
|
|||||||
|
|
||||||
/* Make sure user_rect is current.
|
/* Make sure user_rect is current.
|
||||||
*/
|
*/
|
||||||
save_user_window_placement (window, NULL, TRUE);
|
force_save_user_window_placement (window);
|
||||||
|
|
||||||
meta_window_update_layer (window);
|
meta_window_update_layer (window);
|
||||||
|
|
||||||
@@ -4591,19 +4593,29 @@ meta_window_move_resize_internal (MetaWindow *window,
|
|||||||
* it can be for maximized or fullscreen.
|
* it can be for maximized or fullscreen.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
root_x_nw = new_rect.x;
|
||||||
|
root_y_nw = new_rect.y;
|
||||||
|
|
||||||
if (new_rect.width != window->rect.width ||
|
if (new_rect.width != window->rect.width ||
|
||||||
new_rect.height != window->rect.height)
|
new_rect.height != window->rect.height)
|
||||||
{
|
{
|
||||||
if (!is_wayland_resize)
|
if (!is_wayland_resize)
|
||||||
/* Politely ask for a new size, and wait until the next commit. */
|
|
||||||
meta_wayland_surface_configure_notify (window->surface,
|
meta_wayland_surface_configure_notify (window->surface,
|
||||||
new_rect.width,
|
new_rect.width,
|
||||||
new_rect.height);
|
new_rect.height);
|
||||||
|
|
||||||
/* We need to update window->rect here, otherwise all sorts of
|
meta_rectangle_resize_with_gravity (&old_rect,
|
||||||
bad stuff happens with interactive resizes... */
|
&new_rect,
|
||||||
|
gravity,
|
||||||
|
new_rect.width,
|
||||||
|
new_rect.height);
|
||||||
|
|
||||||
|
if (window->rect.width != new_rect.width ||
|
||||||
|
window->rect.height != new_rect.height)
|
||||||
need_resize_client = TRUE;
|
need_resize_client = TRUE;
|
||||||
|
|
||||||
|
window->rect.width = new_rect.width;
|
||||||
|
window->rect.height = new_rect.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->rect.x != new_rect.x ||
|
if (window->rect.x != new_rect.x ||
|
||||||
@@ -4612,8 +4624,6 @@ meta_window_move_resize_internal (MetaWindow *window,
|
|||||||
|
|
||||||
window->rect.x = new_rect.x;
|
window->rect.x = new_rect.x;
|
||||||
window->rect.y = new_rect.y;
|
window->rect.y = new_rect.y;
|
||||||
window->rect.width = new_rect.width;
|
|
||||||
window->rect.height = new_rect.height;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -4925,9 +4935,9 @@ meta_window_move_resize_internal (MetaWindow *window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!window->placed && window->force_save_user_rect && !window->fullscreen)
|
if (!window->placed && window->force_save_user_rect && !window->fullscreen)
|
||||||
save_user_window_placement (window, &new_rect, TRUE);
|
force_save_user_window_placement (window);
|
||||||
else if (is_user_action)
|
else if (is_user_action)
|
||||||
save_user_window_placement (window, &new_rect, FALSE);
|
save_user_window_placement (window);
|
||||||
|
|
||||||
if (need_move_client || need_move_frame)
|
if (need_move_client || need_move_frame)
|
||||||
g_signal_emit (window, window_signals[POSITION_CHANGED], 0);
|
g_signal_emit (window, window_signals[POSITION_CHANGED], 0);
|
||||||
@@ -5025,13 +5035,12 @@ meta_window_move_resize_wayland (MetaWindow *window,
|
|||||||
|
|
||||||
flags = META_IS_WAYLAND_RESIZE;
|
flags = META_IS_WAYLAND_RESIZE;
|
||||||
|
|
||||||
meta_window_get_position (window, &x, &y);
|
x = window->rect.x + dx;
|
||||||
x += dx; y += dy;
|
y = window->rect.y + dy;
|
||||||
|
|
||||||
if (x != window->rect.x || y != window->rect.y)
|
if (dx != 0 || dy != 0)
|
||||||
flags |= META_IS_MOVE_ACTION;
|
flags |= META_IS_MOVE_ACTION;
|
||||||
if (width != window->rect.width ||
|
if (width != window->rect.width || height != window->rect.height)
|
||||||
height != window->rect.height)
|
|
||||||
flags |= META_IS_RESIZE_ACTION;
|
flags |= META_IS_RESIZE_ACTION;
|
||||||
|
|
||||||
meta_window_move_resize_internal (window, flags, NorthWestGravity,
|
meta_window_move_resize_internal (window, flags, NorthWestGravity,
|
||||||
@@ -6298,7 +6307,7 @@ meta_window_move_resize_request (MetaWindow *window,
|
|||||||
*
|
*
|
||||||
* See also bug 426519.
|
* See also bug 426519.
|
||||||
*/
|
*/
|
||||||
save_user_window_placement (window, NULL, FALSE);
|
save_user_window_placement (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -10297,15 +10306,25 @@ window_focus_on_pointer_rest_callback (gpointer data)
|
|||||||
MetaWindow *window = focus_data->window;
|
MetaWindow *window = focus_data->window;
|
||||||
MetaDisplay *display = window->display;
|
MetaDisplay *display = window->display;
|
||||||
MetaScreen *screen = window->screen;
|
MetaScreen *screen = window->screen;
|
||||||
int root_x, root_y;
|
Window root, child;
|
||||||
|
double root_x, root_y, x, y;
|
||||||
guint32 timestamp;
|
guint32 timestamp;
|
||||||
ClutterActor *child;
|
XIButtonState buttons;
|
||||||
|
XIModifierState mods;
|
||||||
|
XIGroupState group;
|
||||||
|
|
||||||
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK)
|
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
meta_cursor_tracker_get_pointer (screen->cursor_tracker,
|
meta_error_trap_push (display);
|
||||||
&root_x, &root_y, NULL);
|
XIQueryPointer (display->xdisplay,
|
||||||
|
META_VIRTUAL_CORE_POINTER_ID,
|
||||||
|
screen->xroot,
|
||||||
|
&root, &child,
|
||||||
|
&root_x, &root_y, &x, &y,
|
||||||
|
&buttons, &mods, &group);
|
||||||
|
meta_error_trap_pop (display);
|
||||||
|
free (buttons.mask);
|
||||||
|
|
||||||
if (root_x != focus_data->pointer_x ||
|
if (root_x != focus_data->pointer_x ||
|
||||||
root_y != focus_data->pointer_y)
|
root_y != focus_data->pointer_y)
|
||||||
@@ -10315,15 +10334,17 @@ window_focus_on_pointer_rest_callback (gpointer data)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
child = clutter_stage_get_actor_at_pos (CLUTTER_STAGE (clutter_stage_get_default ()),
|
/* Explicitly check for the overlay window, as get_focus_window_at_point()
|
||||||
CLUTTER_PICK_REACTIVE, root_x, root_y);
|
* may return windows that extend underneath the chrome (like
|
||||||
if (!META_IS_SURFACE_ACTOR (child))
|
* override-redirect or DESKTOP windows)
|
||||||
|
*/
|
||||||
|
if (child == meta_get_overlay_window (screen))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
window =
|
window =
|
||||||
meta_stack_get_default_focus_window_at_point (screen->stack,
|
meta_stack_get_default_focus_window_at_point (screen->stack,
|
||||||
screen->active_workspace,
|
screen->active_workspace,
|
||||||
NULL, root_x, root_y);
|
None, root_x, root_y);
|
||||||
|
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
@@ -44,6 +44,8 @@
|
|||||||
static void meta_frames_destroy (GtkWidget *object);
|
static void meta_frames_destroy (GtkWidget *object);
|
||||||
static void meta_frames_finalize (GObject *object);
|
static void meta_frames_finalize (GObject *object);
|
||||||
static void meta_frames_style_updated (GtkWidget *widget);
|
static void meta_frames_style_updated (GtkWidget *widget);
|
||||||
|
static void meta_frames_map (GtkWidget *widget);
|
||||||
|
static void meta_frames_unmap (GtkWidget *widget);
|
||||||
|
|
||||||
static void meta_frames_update_prelit_control (MetaFrames *frames,
|
static void meta_frames_update_prelit_control (MetaFrames *frames,
|
||||||
MetaUIFrame *frame,
|
MetaUIFrame *frame,
|
||||||
@@ -132,6 +134,9 @@ meta_frames_class_init (MetaFramesClass *class)
|
|||||||
|
|
||||||
widget_class->style_updated = meta_frames_style_updated;
|
widget_class->style_updated = meta_frames_style_updated;
|
||||||
|
|
||||||
|
widget_class->map = meta_frames_map;
|
||||||
|
widget_class->unmap = meta_frames_unmap;
|
||||||
|
|
||||||
widget_class->draw = meta_frames_draw;
|
widget_class->draw = meta_frames_draw;
|
||||||
widget_class->destroy_event = meta_frames_destroy_event;
|
widget_class->destroy_event = meta_frames_destroy_event;
|
||||||
widget_class->button_press_event = meta_frames_button_press_event;
|
widget_class->button_press_event = meta_frames_button_press_event;
|
||||||
@@ -226,7 +231,6 @@ meta_frames_init (MetaFrames *frames)
|
|||||||
|
|
||||||
frames->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal,
|
frames->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||||
g_free, g_object_unref);
|
g_free, g_object_unref);
|
||||||
|
|
||||||
update_style_contexts (frames);
|
update_style_contexts (frames);
|
||||||
|
|
||||||
gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE);
|
gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE);
|
||||||
@@ -518,26 +522,13 @@ MetaFrames*
|
|||||||
meta_frames_new (int screen_number)
|
meta_frames_new (int screen_number)
|
||||||
{
|
{
|
||||||
GdkScreen *screen;
|
GdkScreen *screen;
|
||||||
MetaFrames *frames;
|
|
||||||
|
|
||||||
screen = gdk_display_get_screen (gdk_display_get_default (),
|
screen = gdk_display_get_screen (gdk_display_get_default (),
|
||||||
screen_number);
|
screen_number);
|
||||||
|
|
||||||
frames = g_object_new (META_TYPE_FRAMES,
|
return g_object_new (META_TYPE_FRAMES,
|
||||||
"screen", screen,
|
"screen", screen,
|
||||||
"type", GTK_WINDOW_POPUP,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* Put the window at an arbitrary offscreen location; the one place
|
|
||||||
* it can't be is at -100x-100, since the meta_window_new() will
|
|
||||||
* mistake it for a window created via meta_create_offscreen_window()
|
|
||||||
* and ignore it, and we need this window to get frame-synchronization
|
|
||||||
* messages so that GTK+'s style change handling works.
|
|
||||||
*/
|
|
||||||
gtk_window_move (GTK_WINDOW (frames), -200, -200);
|
|
||||||
gtk_window_resize (GTK_WINDOW (frames), 1, 1);
|
|
||||||
|
|
||||||
return frames;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In order to use a style with a window it has to be attached to that
|
/* In order to use a style with a window it has to be attached to that
|
||||||
@@ -644,6 +635,22 @@ meta_frames_unmanage_window (MetaFrames *frames,
|
|||||||
meta_warning ("Frame 0x%lx not managed, can't unmanage\n", xwindow);
|
meta_warning ("Frame 0x%lx not managed, can't unmanage\n", xwindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_frames_map (GtkWidget *widget)
|
||||||
|
{
|
||||||
|
/* We override the parent map function to a no-op because we don't
|
||||||
|
* want to actually show the GDK window. But GTK needs to think that
|
||||||
|
* the widget is mapped or it won't deliver the events we care about.
|
||||||
|
*/
|
||||||
|
gtk_widget_set_mapped (widget, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_frames_unmap (GtkWidget *widget)
|
||||||
|
{
|
||||||
|
gtk_widget_set_mapped (widget, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
static MetaUIFrame*
|
static MetaUIFrame*
|
||||||
meta_frames_lookup_window (MetaFrames *frames,
|
meta_frames_lookup_window (MetaFrames *frames,
|
||||||
Window xwindow)
|
Window xwindow)
|
||||||
|
@@ -295,12 +295,9 @@ meta_ui_new (Display *xdisplay,
|
|||||||
g_assert (gdisplay == gdk_display_get_default ());
|
g_assert (gdisplay == gdk_display_get_default ());
|
||||||
|
|
||||||
ui->frames = meta_frames_new (XScreenNumberOfScreen (screen));
|
ui->frames = meta_frames_new (XScreenNumberOfScreen (screen));
|
||||||
/* GTK+ needs the frame-sync protocol to work in order to properly
|
/* This does not actually show any widget. MetaFrames has been hacked so
|
||||||
* handle style changes. This means that the dummy widget we create
|
* that showing it doesn't actually do anything. But we need the flags
|
||||||
* to get the style for title bars actually needs to be mapped
|
* set for GTK to deliver events properly. */
|
||||||
* and fully tracked as a MetaWindow. Horrible, but mostly harmless -
|
|
||||||
* the window is a 1x1 overide redirect window positioned offscreen.
|
|
||||||
*/
|
|
||||||
gtk_widget_show (GTK_WIDGET (ui->frames));
|
gtk_widget_show (GTK_WIDGET (ui->frames));
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (gdisplay), "meta-ui", ui);
|
g_object_set_data (G_OBJECT (gdisplay), "meta-ui", ui);
|
||||||
|
Reference in New Issue
Block a user