Compare commits
32 Commits
wip/nielsd
...
wip/xwayla
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25fd9e005b | ||
|
|
114bfc04ef | ||
|
|
26dde9dfe0 | ||
|
|
25c9ce2dad | ||
|
|
7d2ef2d821 | ||
|
|
1838ec08a2 | ||
|
|
9a405fb943 | ||
|
|
7515c80d7a | ||
|
|
6ff46b5f64 | ||
|
|
703f05f6e3 | ||
|
|
d2c2fe6e09 | ||
|
|
e2c02c6014 | ||
|
|
c0e6128182 | ||
|
|
4c40b7591d | ||
|
|
6c0e889a85 | ||
|
|
046712a28b | ||
|
|
91c9d5182d | ||
|
|
e0105ee425 | ||
|
|
773aab96bf | ||
|
|
f53a605c4f | ||
|
|
383f2ed815 | ||
|
|
38a8559fbe | ||
|
|
b24136d0d5 | ||
|
|
90826dd660 | ||
|
|
467a6fa8fc | ||
|
|
3974925819 | ||
|
|
b157d34417 | ||
|
|
a2d13e76cc | ||
|
|
a72a2381de | ||
|
|
2d0a1b8179 | ||
|
|
1d97da1631 | ||
|
|
88b5580af7 |
@@ -13,18 +13,18 @@ src/compositor/meta-background.c
|
|||||||
src/core/bell.c
|
src/core/bell.c
|
||||||
src/core/core.c
|
src/core/core.c
|
||||||
src/core/display.c
|
src/core/display.c
|
||||||
src/core/errors.c
|
|
||||||
src/core/keybindings.c
|
src/core/keybindings.c
|
||||||
src/core/main.c
|
src/core/main.c
|
||||||
src/core/meta-close-dialog-default.c
|
src/core/meta-close-dialog-default.c
|
||||||
src/core/mutter.c
|
src/core/mutter.c
|
||||||
src/core/prefs.c
|
src/core/prefs.c
|
||||||
src/core/screen.c
|
|
||||||
src/core/util.c
|
src/core/util.c
|
||||||
src/core/window.c
|
src/core/window.c
|
||||||
src/ui/frames.c
|
src/ui/frames.c
|
||||||
src/ui/theme.c
|
src/ui/theme.c
|
||||||
src/wayland/meta-wayland-tablet-pad.c
|
src/wayland/meta-wayland-tablet-pad.c
|
||||||
|
src/x11/meta-x11-display.c
|
||||||
|
src/x11/meta-x11-errors.c
|
||||||
src/x11/session.c
|
src/x11/session.c
|
||||||
src/x11/window-props.c
|
src/x11/window-props.c
|
||||||
src/x11/xprops.c
|
src/x11/xprops.c
|
||||||
|
|||||||
@@ -247,12 +247,13 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
|||||||
core/edge-resistance.h \
|
core/edge-resistance.h \
|
||||||
core/events.c \
|
core/events.c \
|
||||||
core/events.h \
|
core/events.h \
|
||||||
core/errors.c \
|
|
||||||
meta/errors.h \
|
|
||||||
core/frame.c \
|
core/frame.c \
|
||||||
core/frame.h \
|
core/frame.h \
|
||||||
core/meta-gesture-tracker.c \
|
core/meta-gesture-tracker.c \
|
||||||
core/meta-gesture-tracker-private.h \
|
core/meta-gesture-tracker-private.h \
|
||||||
|
core/meta-workspace-manager.c \
|
||||||
|
core/meta-workspace-manager-private.h \
|
||||||
|
meta/meta-workspace-manager.h \
|
||||||
core/keybindings.c \
|
core/keybindings.c \
|
||||||
core/keybindings-private.h \
|
core/keybindings-private.h \
|
||||||
core/main-private.h \
|
core/main-private.h \
|
||||||
@@ -261,9 +262,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
|||||||
core/place.h \
|
core/place.h \
|
||||||
core/prefs.c \
|
core/prefs.c \
|
||||||
meta/prefs.h \
|
meta/prefs.h \
|
||||||
core/screen.c \
|
|
||||||
core/screen-private.h \
|
|
||||||
meta/screen.h \
|
|
||||||
core/startup-notification.c \
|
core/startup-notification.c \
|
||||||
core/startup-notification-private.h \
|
core/startup-notification-private.h \
|
||||||
meta/types.h \
|
meta/types.h \
|
||||||
@@ -290,6 +288,11 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
|||||||
ui/theme-private.h \
|
ui/theme-private.h \
|
||||||
ui/ui.c \
|
ui/ui.c \
|
||||||
x11/atomnames.h \
|
x11/atomnames.h \
|
||||||
|
x11/meta-x11-display.c \
|
||||||
|
x11/meta-x11-display-private.h \
|
||||||
|
meta/meta-x11-display.h \
|
||||||
|
x11/meta-x11-errors.c \
|
||||||
|
meta/meta-x11-errors.h \
|
||||||
x11/events.c \
|
x11/events.c \
|
||||||
x11/events.h \
|
x11/events.h \
|
||||||
x11/group-private.h \
|
x11/group-private.h \
|
||||||
@@ -449,7 +452,6 @@ libmutterinclude_headers = \
|
|||||||
meta/compositor-mutter.h \
|
meta/compositor-mutter.h \
|
||||||
meta/compositor.h \
|
meta/compositor.h \
|
||||||
meta/display.h \
|
meta/display.h \
|
||||||
meta/errors.h \
|
|
||||||
meta/group.h \
|
meta/group.h \
|
||||||
meta/keybindings.h \
|
meta/keybindings.h \
|
||||||
meta/main.h \
|
meta/main.h \
|
||||||
@@ -470,8 +472,10 @@ libmutterinclude_headers = \
|
|||||||
meta/meta-shadow-factory.h \
|
meta/meta-shadow-factory.h \
|
||||||
meta/meta-window-actor.h \
|
meta/meta-window-actor.h \
|
||||||
meta/meta-window-shape.h \
|
meta/meta-window-shape.h \
|
||||||
|
meta/meta-workspace-manager.h \
|
||||||
|
meta/meta-x11-display.h \
|
||||||
|
meta/meta-x11-errors.h \
|
||||||
meta/prefs.h \
|
meta/prefs.h \
|
||||||
meta/screen.h \
|
|
||||||
meta/theme.h \
|
meta/theme.h \
|
||||||
meta/types.h \
|
meta/types.h \
|
||||||
meta/util.h \
|
meta/util.h \
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
#include <wayland-server.h>
|
#include <wayland-server.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <meta/screen.h>
|
|
||||||
#include "meta-cursor.h"
|
#include "meta-cursor.h"
|
||||||
|
|
||||||
#define META_TYPE_CURSOR_RENDERER (meta_cursor_renderer_get_type ())
|
#define META_TYPE_CURSOR_RENDERER (meta_cursor_renderer_get_type ())
|
||||||
|
|||||||
@@ -31,9 +31,10 @@
|
|||||||
#include "meta-cursor-tracker-private.h"
|
#include "meta-cursor-tracker-private.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <meta/meta-x11-display.h>
|
||||||
#include <meta/main.h>
|
#include <meta/main.h>
|
||||||
#include <meta/util.h>
|
#include <meta/util.h>
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
|
|
||||||
#include <cogl/cogl.h>
|
#include <cogl/cogl.h>
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
@@ -43,6 +44,7 @@
|
|||||||
#include <X11/extensions/Xfixes.h>
|
#include <X11/extensions/Xfixes.h>
|
||||||
|
|
||||||
#include "meta-backend-private.h"
|
#include "meta-backend-private.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT);
|
G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT);
|
||||||
|
|
||||||
@@ -131,15 +133,15 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_cursor_tracker_get_for_screen:
|
* meta_cursor_tracker_get_for_display:
|
||||||
* @screen: the #MetaScreen
|
* @display: the #MetaDisplay
|
||||||
*
|
*
|
||||||
* Retrieves the cursor tracker object for @screen.
|
* Retrieves the cursor tracker object for @display.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none):
|
* Returns: (transfer none):
|
||||||
*/
|
*/
|
||||||
MetaCursorTracker *
|
MetaCursorTracker *
|
||||||
meta_cursor_tracker_get_for_screen (MetaScreen *screen)
|
meta_cursor_tracker_get_for_display (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaBackend *backend = meta_get_backend ();
|
MetaBackend *backend = meta_get_backend ();
|
||||||
MetaCursorTracker *tracker = meta_backend_get_cursor_tracker (backend);
|
MetaCursorTracker *tracker = meta_backend_get_cursor_tracker (backend);
|
||||||
@@ -165,13 +167,13 @@ gboolean
|
|||||||
meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
|
meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
|
||||||
XEvent *xevent)
|
XEvent *xevent)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_get_display ();
|
MetaX11Display *x11_display = meta_get_display ()->x11_display;
|
||||||
XFixesCursorNotifyEvent *notify_event;
|
XFixesCursorNotifyEvent *notify_event;
|
||||||
|
|
||||||
if (meta_is_wayland_compositor ())
|
if (meta_is_wayland_compositor ())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (xevent->xany.type != display->xfixes_event_base + XFixesCursorNotify)
|
if (xevent->xany.type != x11_display->xfixes_event_base + XFixesCursorNotify)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
notify_event = (XFixesCursorNotifyEvent *)xevent;
|
notify_event = (XFixesCursorNotifyEvent *)xevent;
|
||||||
@@ -188,6 +190,7 @@ static void
|
|||||||
ensure_xfixes_cursor (MetaCursorTracker *tracker)
|
ensure_xfixes_cursor (MetaCursorTracker *tracker)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_get_display ();
|
MetaDisplay *display = meta_get_display ();
|
||||||
|
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
XFixesCursorImage *cursor_image;
|
XFixesCursorImage *cursor_image;
|
||||||
CoglTexture2D *sprite;
|
CoglTexture2D *sprite;
|
||||||
guint8 *cursor_data;
|
guint8 *cursor_data;
|
||||||
@@ -198,7 +201,7 @@ ensure_xfixes_cursor (MetaCursorTracker *tracker)
|
|||||||
if (tracker->xfixes_cursor)
|
if (tracker->xfixes_cursor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cursor_image = XFixesGetCursorImage (display->xdisplay);
|
cursor_image = XFixesGetCursorImage (xdisplay);
|
||||||
if (!cursor_image)
|
if (!cursor_image)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,9 @@
|
|||||||
|
|
||||||
#include "meta-cursor.h"
|
#include "meta-cursor.h"
|
||||||
|
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
|
|
||||||
#include "display-private.h"
|
#include "display-private.h"
|
||||||
#include "screen-private.h"
|
|
||||||
#include "meta-backend-private.h"
|
#include "meta-backend-private.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
gboolean meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
gboolean meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||||
MetaCompositor *compositor,
|
MetaCompositor *compositor,
|
||||||
MetaDisplay *display,
|
Display *xdisplay,
|
||||||
XEvent *xev);
|
XEvent *xev);
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
|
|||||||
@@ -210,34 +210,34 @@ meta_logical_monitor_class_init (MetaLogicalMonitorClass *klass)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
|
meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
|
||||||
MetaLogicalMonitor *neighbor,
|
MetaLogicalMonitor *neighbor,
|
||||||
MetaScreenDirection neighbor_direction)
|
MetaDisplayDirection neighbor_direction)
|
||||||
{
|
{
|
||||||
switch (neighbor_direction)
|
switch (neighbor_direction)
|
||||||
{
|
{
|
||||||
case META_SCREEN_RIGHT:
|
case META_DISPLAY_RIGHT:
|
||||||
if (neighbor->rect.x == (logical_monitor->rect.x +
|
if (neighbor->rect.x == (logical_monitor->rect.x +
|
||||||
logical_monitor->rect.width) &&
|
logical_monitor->rect.width) &&
|
||||||
meta_rectangle_vert_overlap (&neighbor->rect,
|
meta_rectangle_vert_overlap (&neighbor->rect,
|
||||||
&logical_monitor->rect))
|
&logical_monitor->rect))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case META_SCREEN_LEFT:
|
case META_DISPLAY_LEFT:
|
||||||
if (logical_monitor->rect.x == (neighbor->rect.x +
|
if (logical_monitor->rect.x == (neighbor->rect.x +
|
||||||
neighbor->rect.width) &&
|
neighbor->rect.width) &&
|
||||||
meta_rectangle_vert_overlap (&neighbor->rect,
|
meta_rectangle_vert_overlap (&neighbor->rect,
|
||||||
&logical_monitor->rect))
|
&logical_monitor->rect))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case META_SCREEN_UP:
|
case META_DISPLAY_UP:
|
||||||
if (logical_monitor->rect.y == (neighbor->rect.y +
|
if (logical_monitor->rect.y == (neighbor->rect.y +
|
||||||
neighbor->rect.height) &&
|
neighbor->rect.height) &&
|
||||||
meta_rectangle_horiz_overlap (&neighbor->rect,
|
meta_rectangle_horiz_overlap (&neighbor->rect,
|
||||||
&logical_monitor->rect))
|
&logical_monitor->rect))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case META_SCREEN_DOWN:
|
case META_DISPLAY_DOWN:
|
||||||
if (neighbor->rect.y == (logical_monitor->rect.y +
|
if (neighbor->rect.y == (logical_monitor->rect.y +
|
||||||
logical_monitor->rect.height) &&
|
logical_monitor->rect.height) &&
|
||||||
meta_rectangle_horiz_overlap (&neighbor->rect,
|
meta_rectangle_horiz_overlap (&neighbor->rect,
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ MetaRectangle meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monit
|
|||||||
|
|
||||||
GList * meta_logical_monitor_get_monitors (MetaLogicalMonitor *logical_monitor);
|
GList * meta_logical_monitor_get_monitors (MetaLogicalMonitor *logical_monitor);
|
||||||
|
|
||||||
gboolean meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
|
gboolean meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
|
||||||
MetaLogicalMonitor *neighbor,
|
MetaLogicalMonitor *neighbor,
|
||||||
MetaScreenDirection neighbor_dir);
|
MetaDisplayDirection neighbor_dir);
|
||||||
|
|
||||||
#endif /* META_LOGICAL_MONITOR_H */
|
#endif /* META_LOGICAL_MONITOR_H */
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
#include <libupower-glib/upower.h>
|
#include <libupower-glib/upower.h>
|
||||||
|
|
||||||
#include "display-private.h"
|
#include "display-private.h"
|
||||||
#include <meta/screen.h>
|
|
||||||
#include "stack-tracker.h"
|
#include "stack-tracker.h"
|
||||||
#include <meta/meta-monitor-manager.h>
|
#include <meta/meta-monitor-manager.h>
|
||||||
|
|
||||||
@@ -438,9 +437,9 @@ MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_at (MetaMonitorMana
|
|||||||
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
||||||
MetaRectangle *rect);
|
MetaRectangle *rect);
|
||||||
|
|
||||||
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
|
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
|
||||||
MetaLogicalMonitor *logical_monitor,
|
MetaLogicalMonitor *logical_monitor,
|
||||||
MetaScreenDirection direction);
|
MetaDisplayDirection direction);
|
||||||
|
|
||||||
MetaMonitor * meta_monitor_manager_get_primary_monitor (MetaMonitorManager *manager);
|
MetaMonitor * meta_monitor_manager_get_primary_monitor (MetaMonitorManager *manager);
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#include <meta/main.h>
|
#include <meta/main.h>
|
||||||
#include "util-private.h"
|
#include "util-private.h"
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "edid.h"
|
#include "edid.h"
|
||||||
#include "backends/meta-logical-monitor.h"
|
#include "backends/meta-logical-monitor.h"
|
||||||
#include "backends/meta-monitor.h"
|
#include "backends/meta-monitor.h"
|
||||||
@@ -2391,9 +2391,9 @@ meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MetaLogicalMonitor *
|
MetaLogicalMonitor *
|
||||||
meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
|
meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
|
||||||
MetaLogicalMonitor *logical_monitor,
|
MetaLogicalMonitor *logical_monitor,
|
||||||
MetaScreenDirection direction)
|
MetaDisplayDirection direction)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
|
|||||||
MetaLogicalMonitor *cur = current;
|
MetaLogicalMonitor *cur = current;
|
||||||
float x = cur_x, y = cur_y;
|
float x = cur_x, y = cur_y;
|
||||||
float dx = *dx_inout, dy = *dy_inout;
|
float dx = *dx_inout, dy = *dy_inout;
|
||||||
MetaScreenDirection direction = -1;
|
MetaDisplayDirection direction = -1;
|
||||||
|
|
||||||
while (cur)
|
while (cur)
|
||||||
{
|
{
|
||||||
@@ -296,18 +296,18 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
|
|||||||
{ cur->rect.x + cur->rect.width, cur->rect.y + cur->rect.height }
|
{ cur->rect.x + cur->rect.width, cur->rect.y + cur->rect.height }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (direction != META_SCREEN_RIGHT &&
|
if (direction != META_DISPLAY_RIGHT &&
|
||||||
meta_line2_intersects_with (&motion, &left, &intersection))
|
meta_line2_intersects_with (&motion, &left, &intersection))
|
||||||
direction = META_SCREEN_LEFT;
|
direction = META_DISPLAY_LEFT;
|
||||||
else if (direction != META_SCREEN_LEFT &&
|
else if (direction != META_DISPLAY_LEFT &&
|
||||||
meta_line2_intersects_with (&motion, &right, &intersection))
|
meta_line2_intersects_with (&motion, &right, &intersection))
|
||||||
direction = META_SCREEN_RIGHT;
|
direction = META_DISPLAY_RIGHT;
|
||||||
else if (direction != META_SCREEN_DOWN &&
|
else if (direction != META_DISPLAY_DOWN &&
|
||||||
meta_line2_intersects_with (&motion, &top, &intersection))
|
meta_line2_intersects_with (&motion, &top, &intersection))
|
||||||
direction = META_SCREEN_UP;
|
direction = META_DISPLAY_UP;
|
||||||
else if (direction != META_SCREEN_UP &&
|
else if (direction != META_DISPLAY_UP &&
|
||||||
meta_line2_intersects_with (&motion, &bottom, &intersection))
|
meta_line2_intersects_with (&motion, &bottom, &intersection))
|
||||||
direction = META_SCREEN_DOWN;
|
direction = META_DISPLAY_DOWN;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* We reached the dest logical monitor */
|
/* We reached the dest logical monitor */
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
#include <xf86drmMode.h>
|
#include <xf86drmMode.h>
|
||||||
|
|
||||||
#include <meta/main.h>
|
#include <meta/main.h>
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
|
|
||||||
#include <gudev/gudev.h>
|
#include <gudev/gudev.h>
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ translate_device_event (MetaBackendX11 *x11,
|
|||||||
|
|
||||||
meta_backend_x11_translate_device_event (x11, device_event);
|
meta_backend_x11_translate_device_event (x11, device_event);
|
||||||
|
|
||||||
if (!device_event->send_event && device_event->time != CurrentTime)
|
if (!device_event->send_event && device_event->time != META_CURRENT_TIME)
|
||||||
{
|
{
|
||||||
if (device_event->time < priv->latest_evtime)
|
if (device_event->time < priv->latest_evtime)
|
||||||
{
|
{
|
||||||
@@ -266,7 +266,7 @@ handle_host_xevent (MetaBackend *backend,
|
|||||||
if (meta_plugin_manager_xevent_filter (compositor->plugin_mgr, event))
|
if (meta_plugin_manager_xevent_filter (compositor->plugin_mgr, event))
|
||||||
bypass_clutter = TRUE;
|
bypass_clutter = TRUE;
|
||||||
|
|
||||||
if (meta_dnd_handle_xdnd_event (backend, compositor, display, event))
|
if (meta_dnd_handle_xdnd_event (backend, compositor, priv->xdisplay, event))
|
||||||
bypass_clutter = TRUE;
|
bypass_clutter = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -484,7 +484,7 @@ meta_backend_x11_grab_device (MetaBackend *backend,
|
|||||||
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (timestamp != CurrentTime)
|
if (timestamp != META_CURRENT_TIME)
|
||||||
timestamp = MAX (timestamp, priv->latest_evtime);
|
timestamp = MAX (timestamp, priv->latest_evtime);
|
||||||
|
|
||||||
XISetMask (mask.mask, XI_ButtonPress);
|
XISetMask (mask.mask, XI_ButtonPress);
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <meta/barrier.h>
|
#include <meta/barrier.h>
|
||||||
#include "backends/x11/meta-barrier-x11.h"
|
#include "backends/x11/meta-barrier-x11.h"
|
||||||
#include "display-private.h"
|
#include "display-private.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
struct _MetaBarrierImplX11Private
|
struct _MetaBarrierImplX11Private
|
||||||
{
|
{
|
||||||
@@ -68,10 +69,11 @@ _meta_barrier_impl_x11_release (MetaBarrierImpl *impl,
|
|||||||
MetaBarrierImplX11Private *priv =
|
MetaBarrierImplX11Private *priv =
|
||||||
meta_barrier_impl_x11_get_instance_private (self);
|
meta_barrier_impl_x11_get_instance_private (self);
|
||||||
MetaDisplay *display = priv->barrier->priv->display;
|
MetaDisplay *display = priv->barrier->priv->display;
|
||||||
|
Display *dpy = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
|
|
||||||
if (META_DISPLAY_HAS_XINPUT_23 (display))
|
if (META_X11_DISPLAY_HAS_XINPUT_23 (display->x11_display))
|
||||||
{
|
{
|
||||||
XIBarrierReleasePointer (display->xdisplay,
|
XIBarrierReleasePointer (dpy,
|
||||||
META_VIRTUAL_CORE_POINTER_ID,
|
META_VIRTUAL_CORE_POINTER_ID,
|
||||||
priv->xbarrier, event->event_id);
|
priv->xbarrier, event->event_id);
|
||||||
}
|
}
|
||||||
@@ -89,13 +91,13 @@ _meta_barrier_impl_x11_destroy (MetaBarrierImpl *impl)
|
|||||||
if (display == NULL)
|
if (display == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dpy = display->xdisplay;
|
dpy = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
|
|
||||||
if (!meta_barrier_is_active (priv->barrier))
|
if (!meta_barrier_is_active (priv->barrier))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
XFixesDestroyPointerBarrier (dpy, priv->xbarrier);
|
XFixesDestroyPointerBarrier (dpy, priv->xbarrier);
|
||||||
g_hash_table_remove (display->xids, &priv->xbarrier);
|
g_hash_table_remove (display->x11_display->xids, &priv->xbarrier);
|
||||||
priv->xbarrier = 0;
|
priv->xbarrier = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +121,7 @@ meta_barrier_impl_x11_new (MetaBarrier *barrier)
|
|||||||
priv = meta_barrier_impl_x11_get_instance_private (self);
|
priv = meta_barrier_impl_x11_get_instance_private (self);
|
||||||
priv->barrier = barrier;
|
priv->barrier = barrier;
|
||||||
|
|
||||||
dpy = display->xdisplay;
|
dpy = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
root = DefaultRootWindow (dpy);
|
root = DefaultRootWindow (dpy);
|
||||||
|
|
||||||
allowed_motion_dirs =
|
allowed_motion_dirs =
|
||||||
@@ -132,7 +134,7 @@ meta_barrier_impl_x11_new (MetaBarrier *barrier)
|
|||||||
allowed_motion_dirs,
|
allowed_motion_dirs,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
|
|
||||||
g_hash_table_insert (display->xids, &priv->xbarrier, barrier);
|
g_hash_table_insert (display->x11_display->xids, &priv->xbarrier, barrier);
|
||||||
|
|
||||||
return META_BARRIER_IMPL (self);
|
return META_BARRIER_IMPL (self);
|
||||||
}
|
}
|
||||||
@@ -172,8 +174,8 @@ meta_barrier_fire_xevent (MetaBarrier *barrier,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_display_process_barrier_xevent (MetaDisplay *display,
|
meta_x11_display_process_barrier_xevent (MetaX11Display *x11_display,
|
||||||
XIEvent *event)
|
XIEvent *event)
|
||||||
{
|
{
|
||||||
MetaBarrier *barrier;
|
MetaBarrier *barrier;
|
||||||
XIBarrierEvent *xev;
|
XIBarrierEvent *xev;
|
||||||
@@ -191,7 +193,7 @@ meta_display_process_barrier_xevent (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
xev = (XIBarrierEvent *) event;
|
xev = (XIBarrierEvent *) event;
|
||||||
barrier = g_hash_table_lookup (display->xids, &xev->barrier);
|
barrier = g_hash_table_lookup (x11_display->xids, &xev->barrier);
|
||||||
if (barrier != NULL)
|
if (barrier != NULL)
|
||||||
{
|
{
|
||||||
meta_barrier_fire_xevent (barrier, xev);
|
meta_barrier_fire_xevent (barrier, xev);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
#include <gudev/gudev.h>
|
#include <gudev/gudev.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "backends/meta-logical-monitor.h"
|
#include "backends/meta-logical-monitor.h"
|
||||||
|
|
||||||
typedef struct _MetaInputSettingsX11Private
|
typedef struct _MetaInputSettingsX11Private
|
||||||
@@ -547,7 +547,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Grab the puke bucket! */
|
/* Grab the puke bucket! */
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
xdev = XOpenDevice (xdisplay, device_id);
|
xdev = XOpenDevice (xdisplay, device_id);
|
||||||
if (xdev)
|
if (xdev)
|
||||||
{
|
{
|
||||||
@@ -557,7 +557,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
|
|||||||
XCloseDevice (xdisplay, xdev);
|
XCloseDevice (xdisplay, xdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (meta_error_trap_pop_with_return (display))
|
if (meta_x11_error_trap_pop_with_return (display->x11_display))
|
||||||
{
|
{
|
||||||
g_warning ("Could not set tablet mapping for %s",
|
g_warning ("Could not set tablet mapping for %s",
|
||||||
clutter_input_device_get_device_name (device));
|
clutter_input_device_get_device_name (device));
|
||||||
@@ -744,7 +744,7 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Grab the puke bucket! */
|
/* Grab the puke bucket! */
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
xdev = XOpenDevice (xdisplay, device_id);
|
xdev = XOpenDevice (xdisplay, device_id);
|
||||||
if (xdev)
|
if (xdev)
|
||||||
{
|
{
|
||||||
@@ -758,7 +758,7 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
|
|||||||
XCloseDevice (xdisplay, xdev);
|
XCloseDevice (xdisplay, xdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (meta_error_trap_pop_with_return (display))
|
if (meta_x11_error_trap_pop_with_return (display->x11_display))
|
||||||
{
|
{
|
||||||
g_warning ("Could not set stylus button map for %s",
|
g_warning ("Could not set stylus button map for %s",
|
||||||
clutter_input_device_get_device_name (device));
|
clutter_input_device_get_device_name (device));
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include "meta-backend-x11.h"
|
#include "meta-backend-x11.h"
|
||||||
#include <meta/main.h>
|
#include <meta/main.h>
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "backends/meta-monitor-config-manager.h"
|
#include "backends/meta-monitor-config-manager.h"
|
||||||
#include "backends/meta-logical-monitor.h"
|
#include "backends/meta-logical-monitor.h"
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
* There's two containers in the stage that are used to place window actors, here
|
* There's two containers in the stage that are used to place window actors, here
|
||||||
* are listed in the order in which they are painted:
|
* are listed in the order in which they are painted:
|
||||||
*
|
*
|
||||||
* - window group, accessible with meta_get_window_group_for_screen()
|
* - window group, accessible with meta_get_window_group_for_display()
|
||||||
* - top window group, accessible with meta_get_top_window_group_for_screen()
|
* - top window group, accessible with meta_get_top_window_group_for_display()
|
||||||
*
|
*
|
||||||
* Mutter will place actors representing windows in the window group, except for
|
* Mutter will place actors representing windows in the window group, except for
|
||||||
* override-redirect windows (ie. popups and menus) which will be placed in the
|
* override-redirect windows (ie. popups and menus) which will be placed in the
|
||||||
@@ -55,8 +55,7 @@
|
|||||||
#include <clutter/x11/clutter-x11.h>
|
#include <clutter/x11/clutter-x11.h>
|
||||||
|
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
#include <meta/screen.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include <meta/errors.h>
|
|
||||||
#include <meta/window.h>
|
#include <meta/window.h>
|
||||||
#include "compositor-private.h"
|
#include "compositor-private.h"
|
||||||
#include <meta/compositor-mutter.h>
|
#include <meta/compositor-mutter.h>
|
||||||
@@ -80,6 +79,8 @@
|
|||||||
#include "backends/x11/meta-backend-x11.h"
|
#include "backends/x11/meta-backend-x11.h"
|
||||||
#include "clutter/clutter-mutter.h"
|
#include "clutter/clutter-mutter.h"
|
||||||
|
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
#include "wayland/meta-wayland-private.h"
|
#include "wayland/meta-wayland-private.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -149,78 +150,78 @@ process_damage (MetaCompositor *compositor,
|
|||||||
|
|
||||||
/* compat helper */
|
/* compat helper */
|
||||||
static MetaCompositor *
|
static MetaCompositor *
|
||||||
get_compositor_for_screen (MetaScreen *screen)
|
get_compositor_for_display (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
return screen->display->compositor;
|
return display->compositor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_get_stage_for_screen:
|
* meta_get_stage_for_display:
|
||||||
* @screen: a #MetaScreen
|
* @display: a #MetaDisplay
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): The #ClutterStage for the screen
|
* Returns: (transfer none): The #ClutterStage for the display
|
||||||
*/
|
*/
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
meta_get_stage_for_screen (MetaScreen *screen)
|
meta_get_stage_for_display (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||||
return compositor->stage;
|
return compositor->stage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_get_window_group_for_screen:
|
* meta_get_window_group_for_display:
|
||||||
* @screen: a #MetaScreen
|
* @display: a #MetaDisplay
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): The window group corresponding to @screen
|
* Returns: (transfer none): The window group corresponding to @display
|
||||||
*/
|
*/
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
meta_get_window_group_for_screen (MetaScreen *screen)
|
meta_get_window_group_for_display (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||||
return compositor->window_group;
|
return compositor->window_group;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_get_top_window_group_for_screen:
|
* meta_get_top_window_group_for_display:
|
||||||
* @screen: a #MetaScreen
|
* @display: a #MetaDisplay
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): The top window group corresponding to @screen
|
* Returns: (transfer none): The top window group corresponding to @display
|
||||||
*/
|
*/
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
meta_get_top_window_group_for_screen (MetaScreen *screen)
|
meta_get_top_window_group_for_display (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||||
return compositor->top_window_group;
|
return compositor->top_window_group;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_get_feedback_group_for_screen:
|
* meta_get_feedback_group_for_display:
|
||||||
* @screen: a #MetaScreen
|
* @display: a #MetaDisplay
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): The feedback group corresponding to @screen
|
* Returns: (transfer none): The feedback group corresponding to @display
|
||||||
*/
|
*/
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
meta_get_feedback_group_for_screen (MetaScreen *screen)
|
meta_get_feedback_group_for_display (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||||
return compositor->feedback_group;
|
return compositor->feedback_group;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_get_window_actors:
|
* meta_get_window_actors:
|
||||||
* @screen: a #MetaScreen
|
* @display: a #MetaDisplay
|
||||||
*
|
*
|
||||||
* Returns: (transfer none) (element-type Clutter.Actor): The set of #MetaWindowActor on @screen
|
* Returns: (transfer none) (element-type Clutter.Actor): The set of #MetaWindowActor on @display
|
||||||
*/
|
*/
|
||||||
GList *
|
GList *
|
||||||
meta_get_window_actors (MetaScreen *screen)
|
meta_get_window_actors (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||||
return compositor->windows;
|
return compositor->windows;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_set_stage_input_region (MetaScreen *screen,
|
meta_set_stage_input_region (MetaDisplay *display,
|
||||||
XserverRegion region)
|
XserverRegion region)
|
||||||
{
|
{
|
||||||
/* As a wayland compositor we can simply ignore all this trickery
|
/* As a wayland compositor we can simply ignore all this trickery
|
||||||
@@ -230,9 +231,8 @@ meta_set_stage_input_region (MetaScreen *screen,
|
|||||||
*/
|
*/
|
||||||
if (!meta_is_wayland_compositor ())
|
if (!meta_is_wayland_compositor ())
|
||||||
{
|
{
|
||||||
MetaDisplay *display = screen->display;
|
|
||||||
MetaCompositor *compositor = display->compositor;
|
MetaCompositor *compositor = display->compositor;
|
||||||
Display *xdpy = meta_display_get_xdisplay (display);
|
Display *xdpy = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
Window xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage));
|
Window xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage));
|
||||||
|
|
||||||
XFixesSetWindowShapeRegion (xdpy, xstage, ShapeInput, 0, 0, region);
|
XFixesSetWindowShapeRegion (xdpy, xstage, ShapeInput, 0, 0, region);
|
||||||
@@ -247,7 +247,7 @@ meta_set_stage_input_region (MetaScreen *screen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_empty_stage_input_region (MetaScreen *screen)
|
meta_empty_stage_input_region (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
/* Using a static region here is a bit hacky, but Metacity never opens more than
|
/* Using a static region here is a bit hacky, but Metacity never opens more than
|
||||||
* one XDisplay, so it works fine. */
|
* one XDisplay, so it works fine. */
|
||||||
@@ -255,22 +255,21 @@ meta_empty_stage_input_region (MetaScreen *screen)
|
|||||||
|
|
||||||
if (region == None)
|
if (region == None)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
Display *xdpy = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
Display *xdpy = meta_display_get_xdisplay (display);
|
|
||||||
region = XFixesCreateRegion (xdpy, NULL, 0);
|
region = XFixesCreateRegion (xdpy, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_set_stage_input_region (screen, region);
|
meta_set_stage_input_region (display, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_focus_stage_window (MetaScreen *screen,
|
meta_focus_stage_window (MetaDisplay *display,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
Window window;
|
Window window;
|
||||||
|
|
||||||
stage = CLUTTER_STAGE (meta_get_stage_for_screen (screen));
|
stage = CLUTTER_STAGE (meta_get_stage_for_display (display));
|
||||||
if (!stage)
|
if (!stage)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -279,14 +278,13 @@ meta_focus_stage_window (MetaScreen *screen,
|
|||||||
if (window == None)
|
if (window == None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
meta_display_set_input_focus_xwindow (screen->display,
|
meta_x11_display_set_input_focus_xwindow (display->x11_display,
|
||||||
screen,
|
window,
|
||||||
window,
|
timestamp);
|
||||||
timestamp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_stage_is_focused (MetaScreen *screen)
|
meta_stage_is_focused (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
Window window;
|
Window window;
|
||||||
@@ -294,7 +292,7 @@ meta_stage_is_focused (MetaScreen *screen)
|
|||||||
if (meta_is_wayland_compositor ())
|
if (meta_is_wayland_compositor ())
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
stage = CLUTTER_STAGE (meta_get_stage_for_screen (screen));
|
stage = CLUTTER_STAGE (meta_get_stage_for_display (display));
|
||||||
if (!stage)
|
if (!stage)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@@ -303,7 +301,7 @@ meta_stage_is_focused (MetaScreen *screen)
|
|||||||
if (window == None)
|
if (window == None)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return (screen->display->focus_xwindow == window);
|
return (display->x11_display->focus_xwindow == window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -364,11 +362,14 @@ meta_begin_modal_for_plugin (MetaCompositor *compositor,
|
|||||||
if (is_modal (display) || display->grab_op != META_GRAB_OP_NONE)
|
if (is_modal (display) || display->grab_op != META_GRAB_OP_NONE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* XXX: why is this needed? */
|
if (display->x11_display)
|
||||||
XIUngrabDevice (display->xdisplay,
|
{
|
||||||
META_VIRTUAL_CORE_POINTER_ID,
|
/* XXX: why is this needed? */
|
||||||
timestamp);
|
XIUngrabDevice (display->x11_display->xdisplay,
|
||||||
XSync (display->xdisplay, False);
|
META_VIRTUAL_CORE_POINTER_ID,
|
||||||
|
timestamp);
|
||||||
|
XSync (display->x11_display->xdisplay, False);
|
||||||
|
}
|
||||||
|
|
||||||
if (!grab_devices (options, timestamp))
|
if (!grab_devices (options, timestamp))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -380,7 +381,7 @@ meta_begin_modal_for_plugin (MetaCompositor *compositor,
|
|||||||
display->grab_have_keyboard = TRUE;
|
display->grab_have_keyboard = TRUE;
|
||||||
|
|
||||||
g_signal_emit_by_name (display, "grab-op-begin",
|
g_signal_emit_by_name (display, "grab-op-begin",
|
||||||
meta_plugin_get_screen (plugin),
|
meta_plugin_get_display (plugin),
|
||||||
display->grab_window, display->grab_op);
|
display->grab_window, display->grab_op);
|
||||||
|
|
||||||
if (meta_is_wayland_compositor ())
|
if (meta_is_wayland_compositor ())
|
||||||
@@ -407,7 +408,7 @@ meta_end_modal_for_plugin (MetaCompositor *compositor,
|
|||||||
g_return_if_fail (is_modal (display));
|
g_return_if_fail (is_modal (display));
|
||||||
|
|
||||||
g_signal_emit_by_name (display, "grab-op-end",
|
g_signal_emit_by_name (display, "grab-op-end",
|
||||||
meta_plugin_get_screen (plugin),
|
meta_plugin_get_display (plugin),
|
||||||
display->grab_window, display->grab_op);
|
display->grab_window, display->grab_op);
|
||||||
|
|
||||||
display->grab_op = META_GRAB_OP_NONE;
|
display->grab_op = META_GRAB_OP_NONE;
|
||||||
@@ -440,14 +441,13 @@ after_stage_paint (ClutterStage *stage,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
redirect_windows (MetaScreen *screen)
|
redirect_windows (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
Display *xdisplay = meta_x11_display_get_xdisplay (x11_display);
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Window xroot = meta_x11_display_get_xroot (x11_display);
|
||||||
Window xroot = meta_screen_get_xroot (screen);
|
int screen_number = meta_x11_display_get_screen_number (x11_display);
|
||||||
int screen_number = meta_screen_get_screen_number (screen);
|
guint n_retries;
|
||||||
guint n_retries;
|
guint max_retries;
|
||||||
guint max_retries;
|
|
||||||
|
|
||||||
if (meta_get_replace_current_wm ())
|
if (meta_get_replace_current_wm ())
|
||||||
max_retries = 5;
|
max_retries = 5;
|
||||||
@@ -462,11 +462,11 @@ redirect_windows (MetaScreen *screen)
|
|||||||
*/
|
*/
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
XCompositeRedirectSubwindows (xdisplay, xroot, CompositeRedirectManual);
|
XCompositeRedirectSubwindows (xdisplay, xroot, CompositeRedirectManual);
|
||||||
XSync (xdisplay, FALSE);
|
XSync (xdisplay, FALSE);
|
||||||
|
|
||||||
if (!meta_error_trap_pop_with_return (display))
|
if (!meta_x11_error_trap_pop_with_return (x11_display))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (n_retries == max_retries)
|
if (n_retries == max_retries)
|
||||||
@@ -474,7 +474,7 @@ redirect_windows (MetaScreen *screen)
|
|||||||
/* This probably means that a non-WM compositor like xcompmgr is running;
|
/* This probably means that a non-WM compositor like xcompmgr is running;
|
||||||
* we have no way to get it to exit */
|
* we have no way to get it to exit */
|
||||||
meta_fatal (_("Another compositing manager is already running on screen %i on display “%s”."),
|
meta_fatal (_("Another compositing manager is already running on screen %i on display “%s”."),
|
||||||
screen_number, display->name);
|
screen_number, x11_display->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
n_retries++;
|
n_retries++;
|
||||||
@@ -486,11 +486,14 @@ void
|
|||||||
meta_compositor_manage (MetaCompositor *compositor)
|
meta_compositor_manage (MetaCompositor *compositor)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = compositor->display;
|
MetaDisplay *display = compositor->display;
|
||||||
Display *xdisplay = display->xdisplay;
|
Display *xdisplay = NULL;
|
||||||
MetaScreen *screen = display->screen;
|
|
||||||
MetaBackend *backend = meta_get_backend ();
|
MetaBackend *backend = meta_get_backend ();
|
||||||
|
|
||||||
meta_screen_set_cm_selection (display->screen);
|
if (display->x11_display)
|
||||||
|
{
|
||||||
|
xdisplay = display->x11_display->xdisplay;
|
||||||
|
meta_x11_display_set_cm_selection (display->x11_display);
|
||||||
|
}
|
||||||
|
|
||||||
compositor->stage = meta_backend_get_stage (backend);
|
compositor->stage = meta_backend_get_stage (backend);
|
||||||
|
|
||||||
@@ -511,9 +514,9 @@ meta_compositor_manage (MetaCompositor *compositor)
|
|||||||
|
|
||||||
clutter_stage_set_sync_delay (CLUTTER_STAGE (compositor->stage), META_SYNC_DELAY);
|
clutter_stage_set_sync_delay (CLUTTER_STAGE (compositor->stage), META_SYNC_DELAY);
|
||||||
|
|
||||||
compositor->window_group = meta_window_group_new (screen);
|
compositor->window_group = meta_window_group_new (display);
|
||||||
compositor->top_window_group = meta_window_group_new (screen);
|
compositor->top_window_group = meta_window_group_new (display);
|
||||||
compositor->feedback_group = meta_window_group_new (screen);
|
compositor->feedback_group = meta_window_group_new (display);
|
||||||
|
|
||||||
clutter_actor_add_child (compositor->stage, compositor->window_group);
|
clutter_actor_add_child (compositor->stage, compositor->window_group);
|
||||||
clutter_actor_add_child (compositor->stage, compositor->top_window_group);
|
clutter_actor_add_child (compositor->stage, compositor->top_window_group);
|
||||||
@@ -530,13 +533,13 @@ meta_compositor_manage (MetaCompositor *compositor)
|
|||||||
{
|
{
|
||||||
Window xwin;
|
Window xwin;
|
||||||
|
|
||||||
compositor->output = screen->composite_overlay_window;
|
compositor->output = display->x11_display->composite_overlay_window;
|
||||||
|
|
||||||
xwin = meta_backend_x11_get_xwindow (META_BACKEND_X11 (backend));
|
xwin = meta_backend_x11_get_xwindow (META_BACKEND_X11 (backend));
|
||||||
|
|
||||||
XReparentWindow (xdisplay, xwin, compositor->output, 0, 0);
|
XReparentWindow (xdisplay, xwin, compositor->output, 0, 0);
|
||||||
|
|
||||||
meta_empty_stage_input_region (screen);
|
meta_empty_stage_input_region (display);
|
||||||
|
|
||||||
/* Make sure there isn't any left-over output shape on the
|
/* Make sure there isn't any left-over output shape on the
|
||||||
* overlay window by setting the whole screen to be an
|
* overlay window by setting the whole screen to be an
|
||||||
@@ -556,7 +559,8 @@ meta_compositor_manage (MetaCompositor *compositor)
|
|||||||
compositor->have_x11_sync_object = meta_sync_ring_init (xdisplay);
|
compositor->have_x11_sync_object = meta_sync_ring_init (xdisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect_windows (display->screen);
|
if (display->x11_display)
|
||||||
|
redirect_windows (display->x11_display);
|
||||||
|
|
||||||
compositor->plugin_mgr = meta_plugin_manager_new (compositor);
|
compositor->plugin_mgr = meta_plugin_manager_new (compositor);
|
||||||
}
|
}
|
||||||
@@ -566,9 +570,9 @@ meta_compositor_unmanage (MetaCompositor *compositor)
|
|||||||
{
|
{
|
||||||
if (!meta_is_wayland_compositor ())
|
if (!meta_is_wayland_compositor ())
|
||||||
{
|
{
|
||||||
MetaDisplay *display = compositor->display;
|
MetaX11Display *display = compositor->display->x11_display;
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = display->xdisplay;
|
||||||
Window xroot = display->screen->xroot;
|
Window xroot = display->xroot;
|
||||||
|
|
||||||
/* This is the most important part of cleanup - we have to do this
|
/* This is the most important part of cleanup - we have to do this
|
||||||
* before giving up the window manager selection or the next
|
* before giving up the window manager selection or the next
|
||||||
@@ -593,7 +597,7 @@ meta_shape_cow_for_window (MetaCompositor *compositor,
|
|||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = compositor->display;
|
MetaDisplay *display = compositor->display;
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
|
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
XFixesSetWindowShapeRegion (xdisplay, compositor->output, ShapeBounding, 0, 0, None);
|
XFixesSetWindowShapeRegion (xdisplay, compositor->output, ShapeBounding, 0, 0, None);
|
||||||
@@ -611,7 +615,7 @@ meta_shape_cow_for_window (MetaCompositor *compositor,
|
|||||||
window_bounds.width = rect.width;
|
window_bounds.width = rect.width;
|
||||||
window_bounds.height = rect.height;
|
window_bounds.height = rect.height;
|
||||||
|
|
||||||
meta_screen_get_size (display->screen, &width, &height);
|
meta_display_get_size (display, &width, &height);
|
||||||
screen_rect.x = 0;
|
screen_rect.x = 0;
|
||||||
screen_rect.y = 0;
|
screen_rect.y = 0;
|
||||||
screen_rect.width = width;
|
screen_rect.width = width;
|
||||||
@@ -654,12 +658,12 @@ meta_compositor_add_window (MetaCompositor *compositor,
|
|||||||
{
|
{
|
||||||
MetaDisplay *display = compositor->display;
|
MetaDisplay *display = compositor->display;
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
|
|
||||||
meta_window_actor_new (window);
|
meta_window_actor_new (window);
|
||||||
sync_actor_stacking (compositor);
|
sync_actor_stacking (compositor);
|
||||||
|
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (display->x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -739,8 +743,10 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
|||||||
XEvent *event,
|
XEvent *event,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaX11Display *x11_display = compositor->display->x11_display;
|
||||||
|
|
||||||
if (!meta_is_wayland_compositor () &&
|
if (!meta_is_wayland_compositor () &&
|
||||||
event->type == meta_display_get_damage_event_base (compositor->display) + XDamageNotify)
|
event->type == meta_x11_display_get_damage_event_base (x11_display) + XDamageNotify)
|
||||||
{
|
{
|
||||||
/* Core code doesn't handle damage events, so we need to extract the MetaWindow
|
/* Core code doesn't handle damage events, so we need to extract the MetaWindow
|
||||||
* ourselves
|
* ourselves
|
||||||
@@ -748,7 +754,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
|||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
{
|
{
|
||||||
Window xwin = ((XDamageNotifyEvent *) event)->drawable;
|
Window xwin = ((XDamageNotifyEvent *) event)->drawable;
|
||||||
window = meta_display_lookup_x_window (compositor->display, xwin);
|
window = meta_x11_display_lookup_x_window (x11_display, xwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
@@ -1109,7 +1115,7 @@ meta_pre_paint_func (gpointer data)
|
|||||||
if (compositor->have_x11_sync_object)
|
if (compositor->have_x11_sync_object)
|
||||||
compositor->have_x11_sync_object = meta_sync_ring_insert_wait ();
|
compositor->have_x11_sync_object = meta_sync_ring_insert_wait ();
|
||||||
else
|
else
|
||||||
XSync (compositor->display->xdisplay, False);
|
XSync (compositor->display->x11_display->xdisplay, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1204,44 +1210,44 @@ meta_compositor_new (MetaDisplay *display)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_get_overlay_window: (skip)
|
* meta_get_overlay_window: (skip)
|
||||||
* @screen: a #MetaScreen
|
* @display: a #MetaDisplay
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Window
|
Window
|
||||||
meta_get_overlay_window (MetaScreen *screen)
|
meta_get_overlay_window (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||||
return compositor->output;
|
return compositor->output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_disable_unredirect_for_screen:
|
* meta_disable_unredirect_for_display:
|
||||||
* @screen: a #MetaScreen
|
* @display: a #MetaDisplay
|
||||||
*
|
*
|
||||||
* Disables unredirection, can be usefull in situations where having
|
* Disables unredirection, can be usefull in situations where having
|
||||||
* unredirected windows is undesireable like when recording a video.
|
* unredirected windows is undesireable like when recording a video.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_disable_unredirect_for_screen (MetaScreen *screen)
|
meta_disable_unredirect_for_display (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||||
compositor->disable_unredirect_count++;
|
compositor->disable_unredirect_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_enable_unredirect_for_screen:
|
* meta_enable_unredirect_for_display:
|
||||||
* @screen: a #MetaScreen
|
* @display: a #MetaDisplay
|
||||||
*
|
*
|
||||||
* Enables unredirection which reduces the overhead for apps like games.
|
* Enables unredirection which reduces the overhead for apps like games.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_enable_unredirect_for_screen (MetaScreen *screen)
|
meta_enable_unredirect_for_display (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||||
if (compositor->disable_unredirect_count == 0)
|
if (compositor->disable_unredirect_count == 0)
|
||||||
g_warning ("Called enable_unredirect_for_screen while unredirection is enabled.");
|
g_warning ("Called enable_unredirect_for_display while unredirection is enabled.");
|
||||||
if (compositor->disable_unredirect_count > 0)
|
if (compositor->disable_unredirect_count > 0)
|
||||||
compositor->disable_unredirect_count--;
|
compositor->disable_unredirect_count--;
|
||||||
}
|
}
|
||||||
@@ -1258,15 +1264,15 @@ flash_out_completed (ClutterTimeline *timeline,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_compositor_flash_screen (MetaCompositor *compositor,
|
meta_compositor_flash_display (MetaCompositor *compositor,
|
||||||
MetaScreen *screen)
|
MetaDisplay *display)
|
||||||
{
|
{
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
ClutterActor *flash;
|
ClutterActor *flash;
|
||||||
ClutterTransition *transition;
|
ClutterTransition *transition;
|
||||||
gfloat width, height;
|
gfloat width, height;
|
||||||
|
|
||||||
stage = meta_get_stage_for_screen (screen);
|
stage = meta_get_stage_for_display (display);
|
||||||
clutter_actor_get_size (stage, &width, &height);
|
clutter_actor_get_size (stage, &width, &height);
|
||||||
|
|
||||||
flash = clutter_actor_new ();
|
flash = clutter_actor_new ();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
#ifndef META_BACKGROUND_ACTOR_PRIVATE_H
|
#ifndef META_BACKGROUND_ACTOR_PRIVATE_H
|
||||||
#define META_BACKGROUND_ACTOR_PRIVATE_H
|
#define META_BACKGROUND_ACTOR_PRIVATE_H
|
||||||
|
|
||||||
#include <meta/screen.h>
|
|
||||||
#include <meta/meta-background-actor.h>
|
#include <meta/meta-background-actor.h>
|
||||||
|
|
||||||
cairo_region_t *meta_background_actor_get_clip_region (MetaBackgroundActor *self);
|
cairo_region_t *meta_background_actor_get_clip_region (MetaBackgroundActor *self);
|
||||||
|
|||||||
@@ -78,14 +78,15 @@
|
|||||||
|
|
||||||
#include "cogl-utils.h"
|
#include "cogl-utils.h"
|
||||||
#include "clutter-utils.h"
|
#include "clutter-utils.h"
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "meta-background-actor-private.h"
|
#include "meta-background-actor-private.h"
|
||||||
#include "meta-background-private.h"
|
#include "meta-background-private.h"
|
||||||
#include "meta-cullable.h"
|
#include "meta-cullable.h"
|
||||||
|
#include "meta/display.h"
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_META_SCREEN = 1,
|
PROP_META_DISPLAY = 1,
|
||||||
PROP_MONITOR,
|
PROP_MONITOR,
|
||||||
PROP_BACKGROUND,
|
PROP_BACKGROUND,
|
||||||
PROP_VIGNETTE,
|
PROP_VIGNETTE,
|
||||||
@@ -127,7 +128,7 @@ typedef enum {
|
|||||||
|
|
||||||
struct _MetaBackgroundActorPrivate
|
struct _MetaBackgroundActorPrivate
|
||||||
{
|
{
|
||||||
MetaScreen *screen;
|
MetaDisplay *display;
|
||||||
int monitor;
|
int monitor;
|
||||||
|
|
||||||
MetaBackground *background;
|
MetaBackground *background;
|
||||||
@@ -186,7 +187,9 @@ get_preferred_size (MetaBackgroundActor *self,
|
|||||||
MetaBackgroundActorPrivate *priv = META_BACKGROUND_ACTOR (self)->priv;
|
MetaBackgroundActorPrivate *priv = META_BACKGROUND_ACTOR (self)->priv;
|
||||||
MetaRectangle monitor_geometry;
|
MetaRectangle monitor_geometry;
|
||||||
|
|
||||||
meta_screen_get_monitor_geometry (priv->screen, priv->monitor, &monitor_geometry);
|
meta_display_get_monitor_geometry (priv->display,
|
||||||
|
priv->monitor,
|
||||||
|
&monitor_geometry);
|
||||||
|
|
||||||
if (width != NULL)
|
if (width != NULL)
|
||||||
*width = monitor_geometry.width;
|
*width = monitor_geometry.width;
|
||||||
@@ -478,8 +481,8 @@ meta_background_actor_set_property (GObject *object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_META_SCREEN:
|
case PROP_META_DISPLAY:
|
||||||
priv->screen = g_value_get_object (value);
|
priv->display = g_value_get_object (value);
|
||||||
break;
|
break;
|
||||||
case PROP_MONITOR:
|
case PROP_MONITOR:
|
||||||
priv->monitor = g_value_get_int (value);
|
priv->monitor = g_value_get_int (value);
|
||||||
@@ -521,8 +524,8 @@ meta_background_actor_get_property (GObject *object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_META_SCREEN:
|
case PROP_META_DISPLAY:
|
||||||
g_value_set_object (value, priv->screen);
|
g_value_set_object (value, priv->display);
|
||||||
break;
|
break;
|
||||||
case PROP_MONITOR:
|
case PROP_MONITOR:
|
||||||
g_value_set_int (value, priv->monitor);
|
g_value_set_int (value, priv->monitor);
|
||||||
@@ -563,14 +566,14 @@ meta_background_actor_class_init (MetaBackgroundActorClass *klass)
|
|||||||
actor_class->get_paint_volume = meta_background_actor_get_paint_volume;
|
actor_class->get_paint_volume = meta_background_actor_get_paint_volume;
|
||||||
actor_class->paint = meta_background_actor_paint;
|
actor_class->paint = meta_background_actor_paint;
|
||||||
|
|
||||||
param_spec = g_param_spec_object ("meta-screen",
|
param_spec = g_param_spec_object ("meta-display",
|
||||||
"MetaScreen",
|
"MetaDisplay",
|
||||||
"MetaScreen",
|
"MetaDisplay",
|
||||||
META_TYPE_SCREEN,
|
META_TYPE_DISPLAY,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||||
|
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
PROP_META_SCREEN,
|
PROP_META_DISPLAY,
|
||||||
param_spec);
|
param_spec);
|
||||||
|
|
||||||
param_spec = g_param_spec_int ("monitor",
|
param_spec = g_param_spec_int ("monitor",
|
||||||
@@ -647,13 +650,13 @@ meta_background_actor_init (MetaBackgroundActor *self)
|
|||||||
* Return value: the newly created background actor
|
* Return value: the newly created background actor
|
||||||
*/
|
*/
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
meta_background_actor_new (MetaScreen *screen,
|
meta_background_actor_new (MetaDisplay *display,
|
||||||
int monitor)
|
int monitor)
|
||||||
{
|
{
|
||||||
MetaBackgroundActor *self;
|
MetaBackgroundActor *self;
|
||||||
|
|
||||||
self = g_object_new (META_TYPE_BACKGROUND_ACTOR,
|
self = g_object_new (META_TYPE_BACKGROUND_ACTOR,
|
||||||
"meta-screen", screen,
|
"meta-display", display,
|
||||||
"monitor", monitor,
|
"monitor", monitor,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,11 @@
|
|||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <meta/display.h>
|
||||||
#include <meta/util.h>
|
#include <meta/util.h>
|
||||||
#include <meta/meta-background.h>
|
#include <meta/meta-background.h>
|
||||||
#include <meta/meta-background-image.h>
|
#include <meta/meta-background-image.h>
|
||||||
|
#include <meta/meta-monitor-manager.h>
|
||||||
#include "meta-background-private.h"
|
#include "meta-background-private.h"
|
||||||
#include "cogl-utils.h"
|
#include "cogl-utils.h"
|
||||||
|
|
||||||
@@ -44,7 +46,7 @@ struct _MetaBackgroundMonitor
|
|||||||
|
|
||||||
struct _MetaBackgroundPrivate
|
struct _MetaBackgroundPrivate
|
||||||
{
|
{
|
||||||
MetaScreen *screen;
|
MetaDisplay *display;
|
||||||
MetaBackgroundMonitor *monitors;
|
MetaBackgroundMonitor *monitors;
|
||||||
int n_monitors;
|
int n_monitors;
|
||||||
|
|
||||||
@@ -68,7 +70,7 @@ struct _MetaBackgroundPrivate
|
|||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_META_SCREEN = 1,
|
PROP_META_DISPLAY = 1,
|
||||||
PROP_MONITOR,
|
PROP_MONITOR,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -128,8 +130,7 @@ free_wallpaper_texture (MetaBackground *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_monitors_changed (MetaScreen *screen,
|
on_monitors_changed (MetaBackground *self)
|
||||||
MetaBackground *self)
|
|
||||||
{
|
{
|
||||||
MetaBackgroundPrivate *priv = self->priv;
|
MetaBackgroundPrivate *priv = self->priv;
|
||||||
|
|
||||||
@@ -138,11 +139,11 @@ on_monitors_changed (MetaScreen *screen,
|
|||||||
priv->monitors = NULL;
|
priv->monitors = NULL;
|
||||||
priv->n_monitors = 0;
|
priv->n_monitors = 0;
|
||||||
|
|
||||||
if (priv->screen)
|
if (priv->display)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
priv->n_monitors = meta_screen_get_n_monitors (screen);
|
priv->n_monitors = meta_display_get_n_monitors (priv->display);
|
||||||
priv->monitors = g_new0 (MetaBackgroundMonitor, priv->n_monitors);
|
priv->monitors = g_new0 (MetaBackgroundMonitor, priv->n_monitors);
|
||||||
|
|
||||||
for (i = 0; i < priv->n_monitors; i++)
|
for (i = 0; i < priv->n_monitors; i++)
|
||||||
@@ -151,27 +152,14 @@ on_monitors_changed (MetaScreen *screen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_screen (MetaBackground *self,
|
set_display (MetaBackground *self,
|
||||||
MetaScreen *screen)
|
MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaBackgroundPrivate *priv = self->priv;
|
MetaBackgroundPrivate *priv = self->priv;
|
||||||
|
|
||||||
if (priv->screen != NULL)
|
priv->display = display;
|
||||||
{
|
|
||||||
g_signal_handlers_disconnect_by_func (priv->screen,
|
|
||||||
(gpointer)on_monitors_changed,
|
|
||||||
self);
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->screen = screen;
|
on_monitors_changed (self);
|
||||||
|
|
||||||
if (priv->screen != NULL)
|
|
||||||
{
|
|
||||||
g_signal_connect (priv->screen, "monitors-changed",
|
|
||||||
G_CALLBACK (on_monitors_changed), self);
|
|
||||||
}
|
|
||||||
|
|
||||||
on_monitors_changed (priv->screen, self);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -182,8 +170,8 @@ meta_background_set_property (GObject *object,
|
|||||||
{
|
{
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_META_SCREEN:
|
case PROP_META_DISPLAY:
|
||||||
set_screen (META_BACKGROUND (object), g_value_get_object (value));
|
set_display (META_BACKGROUND (object), g_value_get_object (value));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
@@ -201,8 +189,8 @@ meta_background_get_property (GObject *object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_META_SCREEN:
|
case PROP_META_DISPLAY:
|
||||||
g_value_set_object (value, priv->screen);
|
g_value_set_object (value, priv->display);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
@@ -304,7 +292,7 @@ meta_background_dispose (GObject *object)
|
|||||||
set_file (self, &priv->file1, &priv->background_image1, NULL);
|
set_file (self, &priv->file1, &priv->background_image1, NULL);
|
||||||
set_file (self, &priv->file2, &priv->background_image2, NULL);
|
set_file (self, &priv->file2, &priv->background_image2, NULL);
|
||||||
|
|
||||||
set_screen (self, NULL);
|
set_display (self, NULL);
|
||||||
|
|
||||||
G_OBJECT_CLASS (meta_background_parent_class)->dispose (object);
|
G_OBJECT_CLASS (meta_background_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
@@ -322,11 +310,15 @@ meta_background_constructed (GObject *object)
|
|||||||
{
|
{
|
||||||
MetaBackground *self = META_BACKGROUND (object);
|
MetaBackground *self = META_BACKGROUND (object);
|
||||||
MetaBackgroundPrivate *priv = self->priv;
|
MetaBackgroundPrivate *priv = self->priv;
|
||||||
|
MetaMonitorManager *monitor_manager = meta_monitor_manager_get ();
|
||||||
|
|
||||||
G_OBJECT_CLASS (meta_background_parent_class)->constructed (object);
|
G_OBJECT_CLASS (meta_background_parent_class)->constructed (object);
|
||||||
|
|
||||||
g_signal_connect_object (meta_screen_get_display (priv->screen), "gl-video-memory-purged",
|
g_signal_connect_object (priv->display, "gl-video-memory-purged",
|
||||||
G_CALLBACK (mark_changed), object, G_CONNECT_SWAPPED);
|
G_CALLBACK (mark_changed), object, G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
|
g_signal_connect_object (monitor_manager, "monitors-changed",
|
||||||
|
G_CALLBACK (on_monitors_changed), self, G_CONNECT_SWAPPED);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -351,14 +343,14 @@ meta_background_class_init (MetaBackgroundClass *klass)
|
|||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
G_TYPE_NONE, 0);
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
param_spec = g_param_spec_object ("meta-screen",
|
param_spec = g_param_spec_object ("meta-display",
|
||||||
"MetaScreen",
|
"MetaDisplay",
|
||||||
"MetaScreen",
|
"MetaDisplay",
|
||||||
META_TYPE_SCREEN,
|
META_TYPE_DISPLAY,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||||
|
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
PROP_META_SCREEN,
|
PROP_META_DISPLAY,
|
||||||
param_spec);
|
param_spec);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -407,7 +399,7 @@ get_texture_area (MetaBackground *self,
|
|||||||
set_texture_area_from_monitor_area (monitor_rect, texture_area);
|
set_texture_area_from_monitor_area (monitor_rect, texture_area);
|
||||||
break;
|
break;
|
||||||
case G_DESKTOP_BACKGROUND_STYLE_WALLPAPER:
|
case G_DESKTOP_BACKGROUND_STYLE_WALLPAPER:
|
||||||
meta_screen_get_size (priv->screen, &screen_width, &screen_height);
|
meta_display_get_size (priv->display, &screen_width, &screen_height);
|
||||||
|
|
||||||
/* Start off by centering a tile in the middle of the
|
/* Start off by centering a tile in the middle of the
|
||||||
* total screen area.
|
* total screen area.
|
||||||
@@ -476,7 +468,7 @@ get_texture_area (MetaBackground *self,
|
|||||||
/* paint region is the union of all monitors, with the origin
|
/* paint region is the union of all monitors, with the origin
|
||||||
* of the region set to align with monitor associated with the background.
|
* of the region set to align with monitor associated with the background.
|
||||||
*/
|
*/
|
||||||
meta_screen_get_size (priv->screen, &screen_width, &screen_height);
|
meta_display_get_size (priv->display, &screen_width, &screen_height);
|
||||||
|
|
||||||
/* unclipped texture area is whole screen */
|
/* unclipped texture area is whole screen */
|
||||||
image_area.width = screen_width;
|
image_area.width = screen_width;
|
||||||
@@ -750,7 +742,9 @@ meta_background_get_texture (MetaBackground *self,
|
|||||||
|
|
||||||
monitor = &priv->monitors[monitor_index];
|
monitor = &priv->monitors[monitor_index];
|
||||||
|
|
||||||
meta_screen_get_monitor_geometry (priv->screen, monitor_index, &geometry);
|
meta_display_get_monitor_geometry (priv->display,
|
||||||
|
monitor_index,
|
||||||
|
&geometry);
|
||||||
monitor_area.x = geometry.x;
|
monitor_area.x = geometry.x;
|
||||||
monitor_area.y = geometry.y;
|
monitor_area.y = geometry.y;
|
||||||
monitor_area.width = geometry.width;
|
monitor_area.width = geometry.width;
|
||||||
@@ -879,10 +873,10 @@ meta_background_get_texture (MetaBackground *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MetaBackground *
|
MetaBackground *
|
||||||
meta_background_new (MetaScreen *screen)
|
meta_background_new (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
return g_object_new (META_TYPE_BACKGROUND,
|
return g_object_new (META_TYPE_BACKGROUND,
|
||||||
"meta-screen", screen,
|
"meta-display", display,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "core/display-private.h"
|
#include "core/display-private.h"
|
||||||
#include "backends/meta-dnd-private.h"
|
#include "backends/meta-dnd-private.h"
|
||||||
#include "meta/meta-dnd.h"
|
#include "meta/meta-dnd.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
struct _MetaDndClass
|
struct _MetaDndClass
|
||||||
{
|
{
|
||||||
@@ -139,7 +140,7 @@ meta_dnd_notify_dnd_leave (MetaDnd *dnd)
|
|||||||
gboolean
|
gboolean
|
||||||
meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||||
MetaCompositor *compositor,
|
MetaCompositor *compositor,
|
||||||
MetaDisplay *display,
|
Display *xdisplay,
|
||||||
XEvent *xev)
|
XEvent *xev)
|
||||||
{
|
{
|
||||||
MetaDnd *dnd = meta_backend_get_dnd (backend);
|
MetaDnd *dnd = meta_backend_get_dnd (backend);
|
||||||
@@ -152,23 +153,23 @@ meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
|||||||
xev->xany.window != clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage)))
|
xev->xany.window != clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (xev->xclient.message_type == gdk_x11_get_xatom_by_name ("XdndPosition"))
|
if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndPosition", TRUE))
|
||||||
{
|
{
|
||||||
XEvent xevent;
|
XEvent xevent;
|
||||||
Window src = xev->xclient.data.l[0];
|
Window src = xev->xclient.data.l[0];
|
||||||
|
|
||||||
memset (&xevent, 0, sizeof(xevent));
|
memset (&xevent, 0, sizeof(xevent));
|
||||||
xevent.xany.type = ClientMessage;
|
xevent.xany.type = ClientMessage;
|
||||||
xevent.xany.display = display->xdisplay;
|
xevent.xany.display = xdisplay;
|
||||||
xevent.xclient.window = src;
|
xevent.xclient.window = src;
|
||||||
xevent.xclient.message_type = gdk_x11_get_xatom_by_name ("XdndStatus");
|
xevent.xclient.message_type = XInternAtom (xdisplay, "XdndStatus", TRUE);
|
||||||
xevent.xclient.format = 32;
|
xevent.xclient.format = 32;
|
||||||
xevent.xclient.data.l[0] = output_window;
|
xevent.xclient.data.l[0] = output_window;
|
||||||
/* flags: bit 0: will we accept the drop? bit 1: do we want more position messages */
|
/* flags: bit 0: will we accept the drop? bit 1: do we want more position messages */
|
||||||
xevent.xclient.data.l[1] = 2;
|
xevent.xclient.data.l[1] = 2;
|
||||||
xevent.xclient.data.l[4] = None;
|
xevent.xclient.data.l[4] = None;
|
||||||
|
|
||||||
XSendEvent (display->xdisplay, src, False, 0, &xevent);
|
XSendEvent (xdisplay, src, False, 0, &xevent);
|
||||||
|
|
||||||
meta_dnd_notify_dnd_position_change (dnd,
|
meta_dnd_notify_dnd_position_change (dnd,
|
||||||
(int)(xev->xclient.data.l[2] >> 16),
|
(int)(xev->xclient.data.l[2] >> 16),
|
||||||
@@ -176,13 +177,13 @@ meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (xev->xclient.message_type == gdk_x11_get_xatom_by_name ("XdndLeave"))
|
else if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndLeave", TRUE))
|
||||||
{
|
{
|
||||||
meta_dnd_notify_dnd_leave (dnd);
|
meta_dnd_notify_dnd_leave (dnd);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (xev->xclient.message_type == gdk_x11_get_xatom_by_name ("XdndEnter"))
|
else if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndEnter", TRUE))
|
||||||
{
|
{
|
||||||
meta_dnd_notify_dnd_enter (dnd);
|
meta_dnd_notify_dnd_enter (dnd);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include "compositor-private.h"
|
#include "compositor-private.h"
|
||||||
#include "meta-plugin-manager.h"
|
#include "meta-plugin-manager.h"
|
||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include <meta/workspace.h>
|
#include <meta/workspace.h>
|
||||||
#include "meta-module.h"
|
#include "meta-module.h"
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#define META_PLUGIN_MANAGER_H_
|
#define META_PLUGIN_MANAGER_H_
|
||||||
|
|
||||||
#include <meta/types.h>
|
#include <meta/types.h>
|
||||||
#include <meta/screen.h>
|
|
||||||
#include <meta/meta-plugin.h>
|
#include <meta/meta-plugin.h>
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
#include <meta/meta-plugin.h>
|
#include <meta/meta-plugin.h>
|
||||||
#include "meta-plugin-manager.h"
|
#include "meta-plugin-manager.h"
|
||||||
#include <meta/screen.h>
|
|
||||||
#include <meta/display.h>
|
#include <meta/display.h>
|
||||||
#include <meta/util.h>
|
#include <meta/util.h>
|
||||||
|
|
||||||
@@ -191,19 +190,19 @@ meta_plugin_end_modal (MetaPlugin *plugin,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_plugin_get_screen:
|
* meta_plugin_get_display:
|
||||||
* @plugin: a #MetaPlugin
|
* @plugin: a #MetaPlugin
|
||||||
*
|
*
|
||||||
* Gets the #MetaScreen corresponding to a plugin.
|
* Gets the #MetaDisplay corresponding to a plugin.
|
||||||
*
|
*
|
||||||
* Return value: (transfer none): the #MetaScreen for the plugin
|
* Return value: (transfer none): the #MetaDisplay for the plugin
|
||||||
*/
|
*/
|
||||||
MetaScreen *
|
MetaDisplay *
|
||||||
meta_plugin_get_screen (MetaPlugin *plugin)
|
meta_plugin_get_display (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return priv->compositor->display->screen;
|
return priv->compositor->display;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -30,11 +30,12 @@
|
|||||||
#include <X11/extensions/Xcomposite.h>
|
#include <X11/extensions/Xcomposite.h>
|
||||||
#include <cogl/winsys/cogl-texture-pixmap-x11.h>
|
#include <cogl/winsys/cogl-texture-pixmap-x11.h>
|
||||||
|
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
#include "meta-shaped-texture-private.h"
|
#include "meta-shaped-texture-private.h"
|
||||||
#include "meta-cullable.h"
|
#include "meta-cullable.h"
|
||||||
#include "x11/window-x11.h"
|
#include "x11/window-x11.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
struct _MetaSurfaceActorX11Private
|
struct _MetaSurfaceActorX11Private
|
||||||
{
|
{
|
||||||
@@ -68,15 +69,15 @@ free_damage (MetaSurfaceActorX11 *self)
|
|||||||
{
|
{
|
||||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||||
MetaDisplay *display = priv->display;
|
MetaDisplay *display = priv->display;
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
|
|
||||||
if (priv->damage == None)
|
if (priv->damage == None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
XDamageDestroy (xdisplay, priv->damage);
|
XDamageDestroy (xdisplay, priv->damage);
|
||||||
priv->damage = None;
|
priv->damage = None;
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (display->x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -84,7 +85,7 @@ detach_pixmap (MetaSurfaceActorX11 *self)
|
|||||||
{
|
{
|
||||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||||
MetaDisplay *display = priv->display;
|
MetaDisplay *display = priv->display;
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
|
MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
|
||||||
|
|
||||||
if (priv->pixmap == None)
|
if (priv->pixmap == None)
|
||||||
@@ -97,10 +98,10 @@ detach_pixmap (MetaSurfaceActorX11 *self)
|
|||||||
meta_shaped_texture_set_texture (stex, NULL);
|
meta_shaped_texture_set_texture (stex, NULL);
|
||||||
cogl_flush ();
|
cogl_flush ();
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
XFreePixmap (xdisplay, priv->pixmap);
|
XFreePixmap (xdisplay, priv->pixmap);
|
||||||
priv->pixmap = None;
|
priv->pixmap = None;
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (display->x11_display);
|
||||||
|
|
||||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||||
}
|
}
|
||||||
@@ -138,7 +139,7 @@ update_pixmap (MetaSurfaceActorX11 *self)
|
|||||||
{
|
{
|
||||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||||
MetaDisplay *display = priv->display;
|
MetaDisplay *display = priv->display;
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
|
|
||||||
if (priv->size_changed)
|
if (priv->size_changed)
|
||||||
{
|
{
|
||||||
@@ -151,10 +152,10 @@ update_pixmap (MetaSurfaceActorX11 *self)
|
|||||||
Pixmap new_pixmap;
|
Pixmap new_pixmap;
|
||||||
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
|
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
new_pixmap = XCompositeNameWindowPixmap (xdisplay, xwindow);
|
new_pixmap = XCompositeNameWindowPixmap (xdisplay, xwindow);
|
||||||
|
|
||||||
if (meta_error_trap_pop_with_return (display) != Success)
|
if (meta_x11_error_trap_pop_with_return (display->x11_display) != Success)
|
||||||
{
|
{
|
||||||
/* Probably a BadMatch if the window isn't viewable; we could
|
/* Probably a BadMatch if the window isn't viewable; we could
|
||||||
* GrabServer/GetWindowAttributes/NameWindowPixmap/UngrabServer/Sync
|
* GrabServer/GetWindowAttributes/NameWindowPixmap/UngrabServer/Sync
|
||||||
@@ -223,13 +224,13 @@ meta_surface_actor_x11_pre_paint (MetaSurfaceActor *actor)
|
|||||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
|
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
|
||||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||||
MetaDisplay *display = priv->display;
|
MetaDisplay *display = priv->display;
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
|
|
||||||
if (priv->received_damage)
|
if (priv->received_damage)
|
||||||
{
|
{
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
XDamageSubtract (xdisplay, priv->damage, None, None);
|
XDamageSubtract (xdisplay, priv->damage, None, None);
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (display->x11_display);
|
||||||
|
|
||||||
priv->received_damage = FALSE;
|
priv->received_damage = FALSE;
|
||||||
}
|
}
|
||||||
@@ -311,10 +312,10 @@ sync_unredirected (MetaSurfaceActorX11 *self)
|
|||||||
{
|
{
|
||||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||||
MetaDisplay *display = priv->display;
|
MetaDisplay *display = priv->display;
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
|
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
|
|
||||||
if (priv->unredirected)
|
if (priv->unredirected)
|
||||||
{
|
{
|
||||||
@@ -326,7 +327,7 @@ sync_unredirected (MetaSurfaceActorX11 *self)
|
|||||||
XCompositeRedirectWindow (xdisplay, xwindow, CompositeRedirectManual);
|
XCompositeRedirectWindow (xdisplay, xwindow, CompositeRedirectManual);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (display->x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -403,7 +404,7 @@ static void
|
|||||||
create_damage (MetaSurfaceActorX11 *self)
|
create_damage (MetaSurfaceActorX11 *self)
|
||||||
{
|
{
|
||||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||||
Display *xdisplay = meta_display_get_xdisplay (priv->display);
|
Display *xdisplay = meta_x11_display_get_xdisplay (priv->display->x11_display);
|
||||||
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
|
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
|
||||||
|
|
||||||
priv->damage = XDamageCreate (xdisplay, xwindow, XDamageReportBoundingBox);
|
priv->damage = XDamageCreate (xdisplay, xwindow, XDamageReportBoundingBox);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <meta/display.h>
|
#include <meta/display.h>
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include <meta/window.h>
|
#include <meta/window.h>
|
||||||
#include <meta/meta-shaped-texture.h>
|
#include <meta/meta-shaped-texture.h>
|
||||||
@@ -36,6 +36,8 @@
|
|||||||
#include "meta-surface-actor.h"
|
#include "meta-surface-actor.h"
|
||||||
#include "meta-surface-actor-x11.h"
|
#include "meta-surface-actor-x11.h"
|
||||||
|
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
#include "meta-surface-actor-wayland.h"
|
#include "meta-surface-actor-wayland.h"
|
||||||
#include "wayland/meta-wayland-surface.h"
|
#include "wayland/meta-wayland-surface.h"
|
||||||
@@ -1944,7 +1946,7 @@ do_send_frame_drawn (MetaWindowActor *self, FrameData *frame)
|
|||||||
{
|
{
|
||||||
MetaWindowActorPrivate *priv = self->priv;
|
MetaWindowActorPrivate *priv = self->priv;
|
||||||
MetaDisplay *display = meta_window_get_display (priv->window);
|
MetaDisplay *display = meta_window_get_display (priv->window);
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
|
|
||||||
XClientMessageEvent ev = { 0, };
|
XClientMessageEvent ev = { 0, };
|
||||||
|
|
||||||
@@ -1954,17 +1956,17 @@ do_send_frame_drawn (MetaWindowActor *self, FrameData *frame)
|
|||||||
|
|
||||||
ev.type = ClientMessage;
|
ev.type = ClientMessage;
|
||||||
ev.window = meta_window_get_xwindow (priv->window);
|
ev.window = meta_window_get_xwindow (priv->window);
|
||||||
ev.message_type = display->atom__NET_WM_FRAME_DRAWN;
|
ev.message_type = display->x11_display->atom__NET_WM_FRAME_DRAWN;
|
||||||
ev.format = 32;
|
ev.format = 32;
|
||||||
ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT(0xffffffff);
|
ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT(0xffffffff);
|
||||||
ev.data.l[1] = frame->sync_request_serial >> 32;
|
ev.data.l[1] = frame->sync_request_serial >> 32;
|
||||||
ev.data.l[2] = frame->frame_drawn_time & G_GUINT64_CONSTANT(0xffffffff);
|
ev.data.l[2] = frame->frame_drawn_time & G_GUINT64_CONSTANT(0xffffffff);
|
||||||
ev.data.l[3] = frame->frame_drawn_time >> 32;
|
ev.data.l[3] = frame->frame_drawn_time >> 32;
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
|
XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
|
||||||
XFlush (xdisplay);
|
XFlush (xdisplay);
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (display->x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2012,13 +2014,13 @@ do_send_frame_timings (MetaWindowActor *self,
|
|||||||
{
|
{
|
||||||
MetaWindowActorPrivate *priv = self->priv;
|
MetaWindowActorPrivate *priv = self->priv;
|
||||||
MetaDisplay *display = meta_window_get_display (priv->window);
|
MetaDisplay *display = meta_window_get_display (priv->window);
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||||
|
|
||||||
XClientMessageEvent ev = { 0, };
|
XClientMessageEvent ev = { 0, };
|
||||||
|
|
||||||
ev.type = ClientMessage;
|
ev.type = ClientMessage;
|
||||||
ev.window = meta_window_get_xwindow (priv->window);
|
ev.window = meta_window_get_xwindow (priv->window);
|
||||||
ev.message_type = display->atom__NET_WM_FRAME_TIMINGS;
|
ev.message_type = display->x11_display->atom__NET_WM_FRAME_TIMINGS;
|
||||||
ev.format = 32;
|
ev.format = 32;
|
||||||
ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT(0xffffffff);
|
ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT(0xffffffff);
|
||||||
ev.data.l[1] = frame->sync_request_serial >> 32;
|
ev.data.l[1] = frame->sync_request_serial >> 32;
|
||||||
@@ -2038,10 +2040,10 @@ do_send_frame_timings (MetaWindowActor *self,
|
|||||||
ev.data.l[3] = refresh_interval;
|
ev.data.l[3] = refresh_interval;
|
||||||
ev.data.l[4] = 1000 * META_SYNC_DELAY;
|
ev.data.l[4] = 1000 * META_SYNC_DELAY;
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
|
XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
|
||||||
XFlush (xdisplay);
|
XFlush (xdisplay);
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (display->x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "meta-window-group.h"
|
#include "meta-window-group.h"
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
#include "meta-cullable.h"
|
#include "meta-cullable.h"
|
||||||
|
#include "display-private.h"
|
||||||
|
|
||||||
struct _MetaWindowGroupClass
|
struct _MetaWindowGroupClass
|
||||||
{
|
{
|
||||||
@@ -23,7 +24,7 @@ struct _MetaWindowGroup
|
|||||||
{
|
{
|
||||||
ClutterActor parent;
|
ClutterActor parent;
|
||||||
|
|
||||||
MetaScreen *screen;
|
MetaDisplay *display;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void cullable_iface_init (MetaCullableInterface *iface);
|
static void cullable_iface_init (MetaCullableInterface *iface);
|
||||||
@@ -64,7 +65,7 @@ meta_window_group_paint (ClutterActor *actor)
|
|||||||
MetaWindowGroup *window_group = META_WINDOW_GROUP (actor);
|
MetaWindowGroup *window_group = META_WINDOW_GROUP (actor);
|
||||||
ClutterActor *stage = clutter_actor_get_stage (actor);
|
ClutterActor *stage = clutter_actor_get_stage (actor);
|
||||||
|
|
||||||
meta_screen_get_size (window_group->screen, &screen_width, &screen_height);
|
meta_display_get_size (window_group->display, &screen_width, &screen_height);
|
||||||
|
|
||||||
/* Normally we expect an actor to be drawn at it's position on the screen.
|
/* Normally we expect an actor to be drawn at it's position on the screen.
|
||||||
* However, if we're inside the paint of a ClutterClone, that won't be the
|
* However, if we're inside the paint of a ClutterClone, that won't be the
|
||||||
@@ -199,13 +200,13 @@ meta_window_group_init (MetaWindowGroup *window_group)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
meta_window_group_new (MetaScreen *screen)
|
meta_window_group_new (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaWindowGroup *window_group;
|
MetaWindowGroup *window_group;
|
||||||
|
|
||||||
window_group = g_object_new (META_TYPE_WINDOW_GROUP, NULL);
|
window_group = g_object_new (META_TYPE_WINDOW_GROUP, NULL);
|
||||||
|
|
||||||
window_group->screen = screen;
|
window_group->display = display;
|
||||||
|
|
||||||
return CLUTTER_ACTOR (window_group);
|
return CLUTTER_ACTOR (window_group);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
#include <meta/screen.h>
|
#include <meta/display.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaWindowGroup:
|
* MetaWindowGroup:
|
||||||
@@ -29,7 +29,7 @@ typedef struct _MetaWindowGroupPrivate MetaWindowGroupPrivate;
|
|||||||
|
|
||||||
GType meta_window_group_get_type (void);
|
GType meta_window_group_get_type (void);
|
||||||
|
|
||||||
ClutterActor *meta_window_group_new (MetaScreen *screen);
|
ClutterActor *meta_window_group_new (MetaDisplay *display);
|
||||||
|
|
||||||
gboolean meta_window_group_actor_is_untransformed (ClutterActor *actor,
|
gboolean meta_window_group_actor_is_untransformed (ClutterActor *actor,
|
||||||
int *x_origin,
|
int *x_origin,
|
||||||
|
|||||||
@@ -21,10 +21,12 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <meta/display.h>
|
||||||
#include <meta/meta-plugin.h>
|
#include <meta/meta-plugin.h>
|
||||||
#include <meta/window.h>
|
#include <meta/window.h>
|
||||||
#include <meta/meta-background-group.h>
|
#include <meta/meta-background-group.h>
|
||||||
#include <meta/meta-background-actor.h>
|
#include <meta/meta-background-actor.h>
|
||||||
|
#include <meta/meta-monitor-manager.h>
|
||||||
#include <meta/util.h>
|
#include <meta/util.h>
|
||||||
#include <glib/gi18n-lib.h>
|
#include <glib/gi18n-lib.h>
|
||||||
|
|
||||||
@@ -38,7 +40,7 @@
|
|||||||
#define SWITCH_TIMEOUT 500
|
#define SWITCH_TIMEOUT 500
|
||||||
|
|
||||||
#define ACTOR_DATA_KEY "MCCP-Default-actor-data"
|
#define ACTOR_DATA_KEY "MCCP-Default-actor-data"
|
||||||
#define SCREEN_TILE_PREVIEW_DATA_KEY "MCCP-Default-screen-tile-preview-data"
|
#define DISPLAY_TILE_PREVIEW_DATA_KEY "MCCP-Default-display-tile-preview-data"
|
||||||
|
|
||||||
#define META_TYPE_DEFAULT_PLUGIN (meta_default_plugin_get_type ())
|
#define META_TYPE_DEFAULT_PLUGIN (meta_default_plugin_get_type ())
|
||||||
#define META_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPlugin))
|
#define META_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPlugin))
|
||||||
@@ -67,7 +69,7 @@ struct _MetaDefaultPluginClass
|
|||||||
};
|
};
|
||||||
|
|
||||||
static GQuark actor_data_quark = 0;
|
static GQuark actor_data_quark = 0;
|
||||||
static GQuark screen_tile_preview_data_quark = 0;
|
static GQuark display_tile_preview_data_quark = 0;
|
||||||
|
|
||||||
static void start (MetaPlugin *plugin);
|
static void start (MetaPlugin *plugin);
|
||||||
static void minimize (MetaPlugin *plugin,
|
static void minimize (MetaPlugin *plugin,
|
||||||
@@ -134,14 +136,14 @@ typedef struct
|
|||||||
} EffectCompleteData;
|
} EffectCompleteData;
|
||||||
|
|
||||||
|
|
||||||
typedef struct _ScreenTilePreview
|
typedef struct _DisplayTilePreview
|
||||||
{
|
{
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
|
|
||||||
GdkRGBA *preview_color;
|
GdkRGBA *preview_color;
|
||||||
|
|
||||||
MetaRectangle tile_rect;
|
MetaRectangle tile_rect;
|
||||||
} ScreenTilePreview;
|
} DisplayTilePreview;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_default_plugin_dispose (GObject *object)
|
meta_default_plugin_dispose (GObject *object)
|
||||||
@@ -285,8 +287,8 @@ on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
|
|||||||
{
|
{
|
||||||
MetaPlugin *plugin = META_PLUGIN (data);
|
MetaPlugin *plugin = META_PLUGIN (data);
|
||||||
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
||||||
MetaScreen *screen = meta_plugin_get_screen (plugin);
|
MetaDisplay *display = meta_plugin_get_display (plugin);
|
||||||
GList *l = meta_get_window_actors (screen);
|
GList *l = meta_get_window_actors (display);
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
@@ -318,16 +320,18 @@ on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_monitors_changed (MetaScreen *screen,
|
on_monitors_changed (MetaMonitorManager *monitor_manager,
|
||||||
MetaPlugin *plugin)
|
MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (plugin);
|
MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (plugin);
|
||||||
|
MetaDisplay *display = meta_plugin_get_display (plugin);
|
||||||
|
|
||||||
int i, n;
|
int i, n;
|
||||||
GRand *rand = g_rand_new_with_seed (123456);
|
GRand *rand = g_rand_new_with_seed (123456);
|
||||||
|
|
||||||
clutter_actor_destroy_all_children (self->priv->background_group);
|
clutter_actor_destroy_all_children (self->priv->background_group);
|
||||||
|
|
||||||
n = meta_screen_get_n_monitors (screen);
|
n = meta_display_get_n_monitors (display);
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
MetaRectangle rect;
|
MetaRectangle rect;
|
||||||
@@ -335,9 +339,9 @@ on_monitors_changed (MetaScreen *screen,
|
|||||||
MetaBackground *background;
|
MetaBackground *background;
|
||||||
ClutterColor color;
|
ClutterColor color;
|
||||||
|
|
||||||
meta_screen_get_monitor_geometry (screen, i, &rect);
|
meta_display_get_monitor_geometry (display, i, &rect);
|
||||||
|
|
||||||
background_actor = meta_background_actor_new (screen, i);
|
background_actor = meta_background_actor_new (display, i);
|
||||||
|
|
||||||
clutter_actor_set_position (background_actor, rect.x, rect.y);
|
clutter_actor_set_position (background_actor, rect.x, rect.y);
|
||||||
clutter_actor_set_size (background_actor, rect.width, rect.height);
|
clutter_actor_set_size (background_actor, rect.width, rect.height);
|
||||||
@@ -352,7 +356,7 @@ on_monitors_changed (MetaScreen *screen,
|
|||||||
g_rand_int_range (rand, 0, 255),
|
g_rand_int_range (rand, 0, 255),
|
||||||
255);
|
255);
|
||||||
|
|
||||||
background = meta_background_new (screen);
|
background = meta_background_new (display);
|
||||||
meta_background_set_color (background, &color);
|
meta_background_set_color (background, &color);
|
||||||
meta_background_actor_set_background (META_BACKGROUND_ACTOR (background_actor), background);
|
meta_background_actor_set_background (META_BACKGROUND_ACTOR (background_actor), background);
|
||||||
g_object_unref (background);
|
g_object_unref (background);
|
||||||
@@ -372,17 +376,19 @@ static void
|
|||||||
start (MetaPlugin *plugin)
|
start (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (plugin);
|
MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (plugin);
|
||||||
MetaScreen *screen = meta_plugin_get_screen (plugin);
|
MetaDisplay *display = meta_plugin_get_display (plugin);
|
||||||
|
MetaMonitorManager *monitor_manager = meta_monitor_manager_get ();
|
||||||
|
|
||||||
self->priv->background_group = meta_background_group_new ();
|
self->priv->background_group = meta_background_group_new ();
|
||||||
clutter_actor_insert_child_below (meta_get_window_group_for_screen (screen),
|
clutter_actor_insert_child_below (meta_get_window_group_for_display (display),
|
||||||
self->priv->background_group, NULL);
|
self->priv->background_group, NULL);
|
||||||
|
|
||||||
g_signal_connect (screen, "monitors-changed",
|
g_signal_connect (monitor_manager, "monitors-changed",
|
||||||
G_CALLBACK (on_monitors_changed), plugin);
|
G_CALLBACK (on_monitors_changed), plugin);
|
||||||
on_monitors_changed (screen, plugin);
|
|
||||||
|
|
||||||
clutter_actor_show (meta_get_stage_for_screen (screen));
|
on_monitors_changed (monitor_manager, plugin);
|
||||||
|
|
||||||
|
clutter_actor_show (meta_get_stage_for_display (display));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -390,7 +396,7 @@ switch_workspace (MetaPlugin *plugin,
|
|||||||
gint from, gint to,
|
gint from, gint to,
|
||||||
MetaMotionDirection direction)
|
MetaMotionDirection direction)
|
||||||
{
|
{
|
||||||
MetaScreen *screen;
|
MetaDisplay *display;
|
||||||
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
||||||
GList *l;
|
GList *l;
|
||||||
ClutterActor *workspace0 = clutter_actor_new ();
|
ClutterActor *workspace0 = clutter_actor_new ();
|
||||||
@@ -398,12 +404,12 @@ switch_workspace (MetaPlugin *plugin,
|
|||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
int screen_width, screen_height;
|
int screen_width, screen_height;
|
||||||
|
|
||||||
screen = meta_plugin_get_screen (plugin);
|
display = meta_plugin_get_display (plugin);
|
||||||
stage = meta_get_stage_for_screen (screen);
|
stage = meta_get_stage_for_display (display);
|
||||||
|
|
||||||
meta_screen_get_size (screen,
|
meta_display_get_size (display,
|
||||||
&screen_width,
|
&screen_width,
|
||||||
&screen_height);
|
&screen_height);
|
||||||
|
|
||||||
clutter_actor_set_pivot_point (workspace1, 1.0, 1.0);
|
clutter_actor_set_pivot_point (workspace1, 1.0, 1.0);
|
||||||
clutter_actor_set_position (workspace1,
|
clutter_actor_set_position (workspace1,
|
||||||
@@ -421,7 +427,7 @@ switch_workspace (MetaPlugin *plugin,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
l = g_list_last (meta_get_window_actors (screen));
|
l = g_list_last (meta_get_window_actors (display));
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
@@ -669,36 +675,36 @@ destroy (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
|||||||
* Tile preview private data accessor
|
* Tile preview private data accessor
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
free_screen_tile_preview (gpointer data)
|
free_display_tile_preview (gpointer data)
|
||||||
{
|
{
|
||||||
ScreenTilePreview *preview = data;
|
DisplayTilePreview *preview = data;
|
||||||
|
|
||||||
if (G_LIKELY (preview != NULL)) {
|
if (G_LIKELY (preview != NULL)) {
|
||||||
clutter_actor_destroy (preview->actor);
|
clutter_actor_destroy (preview->actor);
|
||||||
g_slice_free (ScreenTilePreview, preview);
|
g_slice_free (DisplayTilePreview, preview);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ScreenTilePreview *
|
static DisplayTilePreview *
|
||||||
get_screen_tile_preview (MetaScreen *screen)
|
get_display_tile_preview (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
ScreenTilePreview *preview = g_object_get_qdata (G_OBJECT (screen), screen_tile_preview_data_quark);
|
DisplayTilePreview *preview = g_object_get_qdata (G_OBJECT (display), display_tile_preview_data_quark);
|
||||||
|
|
||||||
if (G_UNLIKELY (screen_tile_preview_data_quark == 0))
|
if (G_UNLIKELY (display_tile_preview_data_quark == 0))
|
||||||
screen_tile_preview_data_quark = g_quark_from_static_string (SCREEN_TILE_PREVIEW_DATA_KEY);
|
display_tile_preview_data_quark = g_quark_from_static_string (DISPLAY_TILE_PREVIEW_DATA_KEY);
|
||||||
|
|
||||||
if (G_UNLIKELY (!preview))
|
if (G_UNLIKELY (!preview))
|
||||||
{
|
{
|
||||||
preview = g_slice_new0 (ScreenTilePreview);
|
preview = g_slice_new0 (DisplayTilePreview);
|
||||||
|
|
||||||
preview->actor = clutter_actor_new ();
|
preview->actor = clutter_actor_new ();
|
||||||
clutter_actor_set_background_color (preview->actor, CLUTTER_COLOR_Blue);
|
clutter_actor_set_background_color (preview->actor, CLUTTER_COLOR_Blue);
|
||||||
clutter_actor_set_opacity (preview->actor, 100);
|
clutter_actor_set_opacity (preview->actor, 100);
|
||||||
|
|
||||||
clutter_actor_add_child (meta_get_window_group_for_screen (screen), preview->actor);
|
clutter_actor_add_child (meta_get_window_group_for_display (display), preview->actor);
|
||||||
g_object_set_qdata_full (G_OBJECT (screen),
|
g_object_set_qdata_full (G_OBJECT (display),
|
||||||
screen_tile_preview_data_quark, preview,
|
display_tile_preview_data_quark, preview,
|
||||||
free_screen_tile_preview);
|
free_display_tile_preview);
|
||||||
}
|
}
|
||||||
|
|
||||||
return preview;
|
return preview;
|
||||||
@@ -710,8 +716,8 @@ show_tile_preview (MetaPlugin *plugin,
|
|||||||
MetaRectangle *tile_rect,
|
MetaRectangle *tile_rect,
|
||||||
int tile_monitor_number)
|
int tile_monitor_number)
|
||||||
{
|
{
|
||||||
MetaScreen *screen = meta_plugin_get_screen (plugin);
|
MetaDisplay *display = meta_plugin_get_display (plugin);
|
||||||
ScreenTilePreview *preview = get_screen_tile_preview (screen);
|
DisplayTilePreview *preview = get_display_tile_preview (display);
|
||||||
ClutterActor *window_actor;
|
ClutterActor *window_actor;
|
||||||
|
|
||||||
if (clutter_actor_is_visible (preview->actor)
|
if (clutter_actor_is_visible (preview->actor)
|
||||||
@@ -737,8 +743,8 @@ show_tile_preview (MetaPlugin *plugin,
|
|||||||
static void
|
static void
|
||||||
hide_tile_preview (MetaPlugin *plugin)
|
hide_tile_preview (MetaPlugin *plugin)
|
||||||
{
|
{
|
||||||
MetaScreen *screen = meta_plugin_get_screen (plugin);
|
MetaDisplay *display = meta_plugin_get_display (plugin);
|
||||||
ScreenTilePreview *preview = get_screen_tile_preview (screen);
|
DisplayTilePreview *preview = get_display_tile_preview (display);
|
||||||
|
|
||||||
clutter_actor_hide (preview->actor);
|
clutter_actor_hide (preview->actor);
|
||||||
}
|
}
|
||||||
|
|||||||
132
src/core/bell.c
132
src/core/bell.c
@@ -49,16 +49,80 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "bell.h"
|
#include "bell.h"
|
||||||
#include "screen-private.h"
|
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
#include "util-private.h"
|
#include "util-private.h"
|
||||||
#include "compositor/compositor-private.h"
|
#include "compositor/compositor-private.h"
|
||||||
#include <meta/prefs.h>
|
|
||||||
#include <meta/compositor.h>
|
#include <meta/compositor.h>
|
||||||
#ifdef HAVE_LIBCANBERRA
|
#ifdef HAVE_LIBCANBERRA
|
||||||
#include <canberra-gtk.h>
|
#include <canberra-gtk.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (MetaBell, meta_bell, G_TYPE_OBJECT)
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
IS_AUDIBLE_CHANGED,
|
||||||
|
LAST_SIGNAL
|
||||||
|
};
|
||||||
|
|
||||||
|
static guint bell_signals [LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
|
static void
|
||||||
|
prefs_changed_callback (MetaPreference pref,
|
||||||
|
void *data)
|
||||||
|
{
|
||||||
|
MetaBell *bell = data;
|
||||||
|
|
||||||
|
if (pref == META_PREF_AUDIBLE_BELL)
|
||||||
|
{
|
||||||
|
g_signal_emit (bell, bell_signals[IS_AUDIBLE_CHANGED], 0,
|
||||||
|
meta_prefs_bell_is_audible ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_bell_finalize (GObject *object)
|
||||||
|
{
|
||||||
|
MetaBell *bell = META_BELL (object);
|
||||||
|
|
||||||
|
meta_prefs_remove_listener (prefs_changed_callback, bell);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (meta_bell_parent_class)->finalize (object);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_bell_class_init (MetaBellClass *klass)
|
||||||
|
{
|
||||||
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
|
object_class->finalize = meta_bell_finalize;
|
||||||
|
|
||||||
|
bell_signals[IS_AUDIBLE_CHANGED] =
|
||||||
|
g_signal_new ("is-audible-changed",
|
||||||
|
G_TYPE_FROM_CLASS (klass),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
0,
|
||||||
|
NULL, NULL, NULL,
|
||||||
|
G_TYPE_NONE, 1,
|
||||||
|
G_TYPE_BOOLEAN);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_bell_init (MetaBell *bell)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_bell_new (MetaDisplay *display)
|
||||||
|
{
|
||||||
|
if (display->bell)
|
||||||
|
return;
|
||||||
|
|
||||||
|
display->bell = g_object_new (META_TYPE_BELL, NULL);
|
||||||
|
|
||||||
|
meta_prefs_add_listener (prefs_changed_callback, display->bell);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bell_flash_fullscreen:
|
* bell_flash_fullscreen:
|
||||||
* @display: The display the event came in on
|
* @display: The display the event came in on
|
||||||
@@ -73,7 +137,7 @@
|
|||||||
static void
|
static void
|
||||||
bell_flash_fullscreen (MetaDisplay *display)
|
bell_flash_fullscreen (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
meta_compositor_flash_screen (display->compositor, display->screen);
|
meta_compositor_flash_display (display->compositor, display);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -226,68 +290,6 @@ meta_bell_notify (MetaDisplay *display,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
meta_bell_set_audible (MetaDisplay *display, gboolean audible)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_LIBCANBERRA
|
|
||||||
/* When we are playing sounds using libcanberra support, we handle the
|
|
||||||
* bell whether its an audible bell or a visible bell */
|
|
||||||
gboolean enable_system_bell = FALSE;
|
|
||||||
#else
|
|
||||||
gboolean enable_system_bell = audible;
|
|
||||||
#endif /* HAVE_LIBCANBERRA */
|
|
||||||
|
|
||||||
XkbChangeEnabledControls (display->xdisplay,
|
|
||||||
XkbUseCoreKbd,
|
|
||||||
XkbAudibleBellMask,
|
|
||||||
enable_system_bell ? XkbAudibleBellMask : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
meta_bell_init (MetaDisplay *display)
|
|
||||||
{
|
|
||||||
int xkb_base_error_type, xkb_opcode;
|
|
||||||
|
|
||||||
if (!XkbQueryExtension (display->xdisplay, &xkb_opcode,
|
|
||||||
&display->xkb_base_event_type,
|
|
||||||
&xkb_base_error_type,
|
|
||||||
NULL, NULL))
|
|
||||||
{
|
|
||||||
display->xkb_base_event_type = -1;
|
|
||||||
g_message ("could not find XKB extension.");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
unsigned int mask = XkbBellNotifyMask;
|
|
||||||
gboolean visual_bell_auto_reset = FALSE;
|
|
||||||
/* TRUE if and when non-broken version is available */
|
|
||||||
XkbSelectEvents (display->xdisplay,
|
|
||||||
XkbUseCoreKbd,
|
|
||||||
XkbBellNotifyMask,
|
|
||||||
XkbBellNotifyMask);
|
|
||||||
meta_bell_set_audible (display, meta_prefs_bell_is_audible ());
|
|
||||||
if (visual_bell_auto_reset) {
|
|
||||||
XkbSetAutoResetControls (display->xdisplay,
|
|
||||||
XkbAudibleBellMask,
|
|
||||||
&mask,
|
|
||||||
&mask);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
meta_bell_shutdown (MetaDisplay *display)
|
|
||||||
{
|
|
||||||
/* TODO: persist initial bell state in display, reset here */
|
|
||||||
XkbChangeEnabledControls (display->xdisplay,
|
|
||||||
XkbUseCoreKbd,
|
|
||||||
XkbAudibleBellMask,
|
|
||||||
XkbAudibleBellMask);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_bell_notify_frame_destroy:
|
* meta_bell_notify_frame_destroy:
|
||||||
* @frame: The frame which is being destroyed
|
* @frame: The frame which is being destroyed
|
||||||
|
|||||||
@@ -17,11 +17,19 @@
|
|||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/XKBlib.h>
|
|
||||||
#include "display-private.h"
|
#include "display-private.h"
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
|
|
||||||
|
struct _MetaBell
|
||||||
|
{
|
||||||
|
GObject parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define META_TYPE_BELL (meta_bell_get_type ())
|
||||||
|
G_DECLARE_FINAL_TYPE (MetaBell, meta_bell, META, BELL, GObject)
|
||||||
|
|
||||||
|
void meta_bell_new (MetaDisplay *display);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_bell_notify:
|
* meta_bell_notify:
|
||||||
* @display: The display the bell event came in on
|
* @display: The display the bell event came in on
|
||||||
@@ -34,48 +42,6 @@
|
|||||||
gboolean meta_bell_notify (MetaDisplay *display,
|
gboolean meta_bell_notify (MetaDisplay *display,
|
||||||
MetaWindow *window);
|
MetaWindow *window);
|
||||||
|
|
||||||
/**
|
|
||||||
* meta_bell_set_audible:
|
|
||||||
* @display: The display we're configuring
|
|
||||||
* @audible: True for an audible bell, false for a visual bell
|
|
||||||
*
|
|
||||||
* Turns the bell to audible or visual. This tells X what to do, but
|
|
||||||
* not Mutter; you will need to set the "visual bell" pref for that.
|
|
||||||
*
|
|
||||||
* If the configure script found we had no XKB, this is a no-op.
|
|
||||||
*/
|
|
||||||
void meta_bell_set_audible (MetaDisplay *display, gboolean audible);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* meta_bell_init:
|
|
||||||
* @display: The display which is opening
|
|
||||||
*
|
|
||||||
* Initialises the bell subsystem. This involves intialising
|
|
||||||
* XKB (which, despite being a keyboard extension, is the
|
|
||||||
* place to look for bell notifications), then asking it
|
|
||||||
* to send us bell notifications, and then also switching
|
|
||||||
* off the audible bell if we're using a visual one ourselves.
|
|
||||||
*
|
|
||||||
* \bug There is a line of code that's never run that tells
|
|
||||||
* XKB to reset the bell status after we quit. Bill H said
|
|
||||||
* (<http://bugzilla.gnome.org/show_bug.cgi?id=99886#c12>)
|
|
||||||
* that XFree86's implementation is broken so we shouldn't
|
|
||||||
* call it, but that was in 2002. Is it working now?
|
|
||||||
*/
|
|
||||||
gboolean meta_bell_init (MetaDisplay *display);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* meta_bell_shutdown:
|
|
||||||
* @display: The display which is closing
|
|
||||||
*
|
|
||||||
* Shuts down the bell subsystem.
|
|
||||||
*
|
|
||||||
* \bug This is never called! If we had XkbSetAutoResetControls
|
|
||||||
* enabled in meta_bell_init(), this wouldn't be a problem, but
|
|
||||||
* we don't.
|
|
||||||
*/
|
|
||||||
void meta_bell_shutdown (MetaDisplay *display);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_bell_notify_frame_destroy:
|
* meta_bell_notify_frame_destroy:
|
||||||
* @frame: The frame which is being destroyed
|
* @frame: The frame which is being destroyed
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "boxes-private.h"
|
#include "boxes-private.h"
|
||||||
#include "constraints.h"
|
#include "constraints.h"
|
||||||
|
#include "meta-workspace-manager-private.h"
|
||||||
#include "workspace-private.h"
|
#include "workspace-private.h"
|
||||||
#include "place.h"
|
#include "place.h"
|
||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
@@ -412,7 +413,7 @@ setup_constraint_info (ConstraintInfo *info,
|
|||||||
&info->entire_monitor);
|
&info->entire_monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_workspace = window->screen->active_workspace;
|
cur_workspace = window->display->workspace_manager->active_workspace;
|
||||||
info->usable_screen_region =
|
info->usable_screen_region =
|
||||||
meta_workspace_get_onscreen_region (cur_workspace);
|
meta_workspace_get_onscreen_region (cur_workspace);
|
||||||
info->usable_monitor_region =
|
info->usable_monitor_region =
|
||||||
@@ -499,7 +500,7 @@ place_window_if_needed(MetaWindow *window,
|
|||||||
meta_window_get_work_area_for_logical_monitor (window,
|
meta_window_get_work_area_for_logical_monitor (window,
|
||||||
logical_monitor,
|
logical_monitor,
|
||||||
&info->work_area_monitor);
|
&info->work_area_monitor);
|
||||||
cur_workspace = window->screen->active_workspace;
|
cur_workspace = window->display->workspace_manager->active_workspace;
|
||||||
info->usable_monitor_region =
|
info->usable_monitor_region =
|
||||||
meta_workspace_get_onmonitor_region (cur_workspace, logical_monitor);
|
meta_workspace_get_onmonitor_region (cur_workspace, logical_monitor);
|
||||||
|
|
||||||
@@ -926,6 +927,7 @@ constrain_maximization (MetaWindow *window,
|
|||||||
ConstraintPriority priority,
|
ConstraintPriority priority,
|
||||||
gboolean check_only)
|
gboolean check_only)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
MetaRectangle target_size;
|
MetaRectangle target_size;
|
||||||
MetaRectangle min_size, max_size;
|
MetaRectangle min_size, max_size;
|
||||||
gboolean hminbad, vminbad;
|
gboolean hminbad, vminbad;
|
||||||
@@ -965,7 +967,7 @@ constrain_maximization (MetaWindow *window,
|
|||||||
direction = META_DIRECTION_HORIZONTAL;
|
direction = META_DIRECTION_HORIZONTAL;
|
||||||
else
|
else
|
||||||
direction = META_DIRECTION_VERTICAL;
|
direction = META_DIRECTION_VERTICAL;
|
||||||
active_workspace_struts = window->screen->active_workspace->all_struts;
|
active_workspace_struts = workspace_manager->active_workspace->all_struts;
|
||||||
|
|
||||||
target_size = info->current;
|
target_size = info->current;
|
||||||
meta_rectangle_expand_to_avoiding_struts (&target_size,
|
meta_rectangle_expand_to_avoiding_struts (&target_size,
|
||||||
|
|||||||
@@ -24,11 +24,13 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
|
#include "meta-workspace-manager-private.h"
|
||||||
#include "workspace-private.h"
|
#include "workspace-private.h"
|
||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "util-private.h"
|
#include "util-private.h"
|
||||||
|
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
#include "x11/window-x11.h"
|
#include "x11/window-x11.h"
|
||||||
#include "x11/window-x11-private.h"
|
#include "x11/window-x11-private.h"
|
||||||
|
|
||||||
@@ -51,7 +53,7 @@ get_window (Display *xdisplay,
|
|||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
display = meta_display_for_x_display (xdisplay);
|
display = meta_display_for_x_display (xdisplay);
|
||||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
window = meta_x11_display_lookup_x_window (display->x11_display, frame_xwindow);
|
||||||
|
|
||||||
if (window == NULL || window->frame == NULL)
|
if (window == NULL || window->frame == NULL)
|
||||||
{
|
{
|
||||||
@@ -76,6 +78,8 @@ static gboolean
|
|||||||
lower_window_and_transients (MetaWindow *window,
|
lower_window_and_transients (MetaWindow *window,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
meta_window_lower (window);
|
meta_window_lower (window);
|
||||||
|
|
||||||
meta_window_foreach_transient (window, lower_window_and_transients, NULL);
|
meta_window_foreach_transient (window, lower_window_and_transients, NULL);
|
||||||
@@ -86,22 +90,22 @@ lower_window_and_transients (MetaWindow *window,
|
|||||||
* Do extra sanity checks to avoid possible race conditions.
|
* Do extra sanity checks to avoid possible race conditions.
|
||||||
* (Borrowed from window.c.)
|
* (Borrowed from window.c.)
|
||||||
*/
|
*/
|
||||||
if (window->screen->active_workspace &&
|
if (workspace_manager->active_workspace &&
|
||||||
meta_window_located_on_workspace (window,
|
meta_window_located_on_workspace (window,
|
||||||
window->screen->active_workspace))
|
workspace_manager->active_workspace))
|
||||||
{
|
{
|
||||||
GList* link;
|
GList* link;
|
||||||
link = g_list_find (window->screen->active_workspace->mru_list,
|
link = g_list_find (workspace_manager->active_workspace->mru_list,
|
||||||
window);
|
window);
|
||||||
g_assert (link);
|
g_assert (link);
|
||||||
|
|
||||||
window->screen->active_workspace->mru_list =
|
workspace_manager->active_workspace->mru_list =
|
||||||
g_list_remove_link (window->screen->active_workspace->mru_list,
|
g_list_remove_link (workspace_manager->active_workspace->mru_list,
|
||||||
link);
|
link);
|
||||||
g_list_free (link);
|
g_list_free (link);
|
||||||
|
|
||||||
window->screen->active_workspace->mru_list =
|
workspace_manager->active_workspace->mru_list =
|
||||||
g_list_append (window->screen->active_workspace->mru_list,
|
g_list_append (workspace_manager->active_workspace->mru_list,
|
||||||
window);
|
window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,6 +119,7 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
|
|||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
lower_window_and_transients (window, NULL);
|
lower_window_and_transients (window, NULL);
|
||||||
|
|
||||||
@@ -122,7 +127,7 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
|
|||||||
* the focus window, assume that's always the case. (Typically,
|
* the focus window, assume that's always the case. (Typically,
|
||||||
* this will be invoked via keyboard action or by a mouse action;
|
* this will be invoked via keyboard action or by a mouse action;
|
||||||
* in either case the window or a modal child will have been focused.) */
|
* in either case the window or a modal child will have been focused.) */
|
||||||
meta_workspace_focus_default_window (window->screen->active_workspace,
|
meta_workspace_focus_default_window (workspace_manager->active_workspace,
|
||||||
NULL,
|
NULL,
|
||||||
timestamp);
|
timestamp);
|
||||||
}
|
}
|
||||||
@@ -219,14 +224,10 @@ meta_core_begin_grab_op (Display *xdisplay,
|
|||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
MetaScreen *screen;
|
|
||||||
|
|
||||||
display = meta_display_for_x_display (xdisplay);
|
display = meta_display_for_x_display (xdisplay);
|
||||||
screen = display->screen;
|
|
||||||
|
|
||||||
g_assert (screen != NULL);
|
return meta_display_begin_grab_op (display, window,
|
||||||
|
|
||||||
return meta_display_begin_grab_op (display, screen, window,
|
|
||||||
op, pointer_already_grabbed,
|
op, pointer_already_grabbed,
|
||||||
frame_action,
|
frame_action,
|
||||||
button, modmask,
|
button, modmask,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include "util-private.h"
|
#include "util-private.h"
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
#include "compositor-private.h"
|
#include "compositor-private.h"
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include <meta/workspace.h>
|
#include <meta/workspace.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include "keybindings-private.h"
|
#include "keybindings-private.h"
|
||||||
#include "startup-notification-private.h"
|
#include "startup-notification-private.h"
|
||||||
#include "meta-gesture-tracker-private.h"
|
#include "meta-gesture-tracker-private.h"
|
||||||
|
#include "stack-tracker.h"
|
||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
#include <meta/barrier.h>
|
#include <meta/barrier.h>
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
@@ -47,12 +48,10 @@
|
|||||||
|
|
||||||
#include <X11/extensions/sync.h>
|
#include <X11/extensions/sync.h>
|
||||||
|
|
||||||
|
typedef struct _MetaBell MetaBell;
|
||||||
typedef struct _MetaStack MetaStack;
|
typedef struct _MetaStack MetaStack;
|
||||||
typedef struct _MetaUISlave MetaUISlave;
|
typedef struct _MetaUISlave MetaUISlave;
|
||||||
|
|
||||||
typedef struct _MetaGroupPropHooks MetaGroupPropHooks;
|
|
||||||
typedef struct _MetaWindowPropHooks MetaWindowPropHooks;
|
|
||||||
|
|
||||||
typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
|
typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -102,43 +101,23 @@ typedef enum {
|
|||||||
META_EVENT_ROUTE_FRAME_BUTTON,
|
META_EVENT_ROUTE_FRAME_BUTTON,
|
||||||
} MetaEventRoute;
|
} MetaEventRoute;
|
||||||
|
|
||||||
typedef gboolean (*MetaAlarmFilter) (MetaDisplay *display,
|
typedef void (* MetaDisplayWindowFunc) (MetaWindow *window,
|
||||||
XSyncAlarmNotifyEvent *event,
|
gpointer user_data);
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
struct _MetaDisplay
|
struct _MetaDisplay
|
||||||
{
|
{
|
||||||
GObject parent_instance;
|
GObject parent_instance;
|
||||||
|
|
||||||
char *name;
|
MetaX11Display *x11_display;
|
||||||
Display *xdisplay;
|
|
||||||
|
|
||||||
int clutter_event_filter;
|
int clutter_event_filter;
|
||||||
|
|
||||||
Window leader_window;
|
|
||||||
Window timestamp_pinging_window;
|
|
||||||
|
|
||||||
/* Pull in all the names of atoms as fields; we will intern them when the
|
|
||||||
* class is constructed.
|
|
||||||
*/
|
|
||||||
#define item(x) Atom atom_##x;
|
|
||||||
#include <x11/atomnames.h>
|
|
||||||
#undef item
|
|
||||||
|
|
||||||
/* The window and serial of the most recent FocusIn event. */
|
|
||||||
Window server_focus_window;
|
|
||||||
gulong server_focus_serial;
|
|
||||||
|
|
||||||
/* Our best guess as to the "currently" focused window (that is, the
|
/* Our best guess as to the "currently" focused window (that is, the
|
||||||
* window that we expect will be focused at the point when the X
|
* window that we expect will be focused at the point when the X
|
||||||
* server processes our next request), and the serial of the request
|
* server processes our next request), and the serial of the request
|
||||||
* or event that caused this.
|
* or event that caused this.
|
||||||
*/
|
*/
|
||||||
MetaWindow *focus_window;
|
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 */
|
/* last timestamp passed to XSetInputFocus */
|
||||||
guint32 last_focus_time;
|
guint32 last_focus_time;
|
||||||
@@ -169,8 +148,6 @@ struct _MetaDisplay
|
|||||||
guint focused_by_us : 1;
|
guint focused_by_us : 1;
|
||||||
|
|
||||||
/*< private-ish >*/
|
/*< private-ish >*/
|
||||||
MetaScreen *screen;
|
|
||||||
GHashTable *xids;
|
|
||||||
GHashTable *stamps;
|
GHashTable *stamps;
|
||||||
GHashTable *wayland_windows;
|
GHashTable *wayland_windows;
|
||||||
|
|
||||||
@@ -229,9 +206,6 @@ struct _MetaDisplay
|
|||||||
* to avoid some race conditions on EnterNotify events
|
* to avoid some race conditions on EnterNotify events
|
||||||
*/
|
*/
|
||||||
int sentinel_counter;
|
int sentinel_counter;
|
||||||
|
|
||||||
int xkb_base_event_type;
|
|
||||||
guint32 last_bell_time;
|
|
||||||
int grab_resize_timeout_id;
|
int grab_resize_timeout_id;
|
||||||
|
|
||||||
MetaKeyBindingManager key_binding_manager;
|
MetaKeyBindingManager key_binding_manager;
|
||||||
@@ -245,60 +219,30 @@ struct _MetaDisplay
|
|||||||
/* Closing down the display */
|
/* Closing down the display */
|
||||||
int closing;
|
int closing;
|
||||||
|
|
||||||
/* Managed by group.c */
|
|
||||||
GHashTable *groups_by_leader;
|
|
||||||
|
|
||||||
/* Managed by window-props.c */
|
|
||||||
MetaWindowPropHooks *prop_hooks_table;
|
|
||||||
GHashTable *prop_hooks;
|
|
||||||
int n_prop_hooks;
|
|
||||||
|
|
||||||
/* Managed by group-props.c */
|
|
||||||
MetaGroupPropHooks *group_prop_hooks;
|
|
||||||
|
|
||||||
/* Managed by compositor.c */
|
/* Managed by compositor.c */
|
||||||
MetaCompositor *compositor;
|
MetaCompositor *compositor;
|
||||||
|
|
||||||
MetaGestureTracker *gesture_tracker;
|
MetaGestureTracker *gesture_tracker;
|
||||||
ClutterEventSequence *pointer_emulating_sequence;
|
ClutterEventSequence *pointer_emulating_sequence;
|
||||||
|
|
||||||
MetaAlarmFilter alarm_filter;
|
|
||||||
gpointer alarm_filter_data;
|
|
||||||
|
|
||||||
int composite_event_base;
|
|
||||||
int composite_error_base;
|
|
||||||
int composite_major_version;
|
|
||||||
int composite_minor_version;
|
|
||||||
int damage_event_base;
|
|
||||||
int damage_error_base;
|
|
||||||
int xfixes_event_base;
|
|
||||||
int xfixes_error_base;
|
|
||||||
int xinput_error_base;
|
|
||||||
int xinput_event_base;
|
|
||||||
int xinput_opcode;
|
|
||||||
|
|
||||||
ClutterActor *current_pad_osd;
|
ClutterActor *current_pad_osd;
|
||||||
|
|
||||||
MetaStartupNotification *startup_notification;
|
MetaStartupNotification *startup_notification;
|
||||||
|
|
||||||
int xsync_event_base;
|
MetaCursor current_cursor;
|
||||||
int xsync_error_base;
|
|
||||||
int shape_event_base;
|
MetaStack *stack;
|
||||||
int shape_error_base;
|
MetaStackTracker *stack_tracker;
|
||||||
unsigned int have_xsync : 1;
|
|
||||||
#define META_DISPLAY_HAS_XSYNC(display) ((display)->have_xsync)
|
guint tile_preview_timeout_id;
|
||||||
unsigned int have_shape : 1;
|
|
||||||
#define META_DISPLAY_HAS_SHAPE(display) ((display)->have_shape)
|
GSList *startup_sequences;
|
||||||
unsigned int have_composite : 1;
|
|
||||||
unsigned int have_damage : 1;
|
guint work_area_later;
|
||||||
#define META_DISPLAY_HAS_COMPOSITE(display) ((display)->have_composite)
|
guint check_fullscreen_later;
|
||||||
#define META_DISPLAY_HAS_DAMAGE(display) ((display)->have_damage)
|
|
||||||
#ifdef HAVE_XI23
|
MetaBell *bell;
|
||||||
gboolean have_xinput_23 : 1;
|
MetaWorkspaceManager *workspace_manager;
|
||||||
#define META_DISPLAY_HAS_XINPUT_23(display) ((display)->have_xinput_23)
|
|
||||||
#else
|
|
||||||
#define META_DISPLAY_HAS_XINPUT_23(display) FALSE
|
|
||||||
#endif /* HAVE_XI23 */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MetaDisplayClass
|
struct _MetaDisplayClass
|
||||||
@@ -325,25 +269,14 @@ gboolean meta_display_open (void);
|
|||||||
void meta_display_close (MetaDisplay *display,
|
void meta_display_close (MetaDisplay *display,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
|
|
||||||
void meta_display_unmanage_windows_for_screen (MetaDisplay *display,
|
void meta_display_manage_all_windows (MetaDisplay *display);
|
||||||
MetaScreen *screen,
|
void meta_display_unmanage_windows (MetaDisplay *display,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
|
|
||||||
/* Utility function to compare the stacking of two windows */
|
/* Utility function to compare the stacking of two windows */
|
||||||
int meta_display_stack_cmp (const void *a,
|
int meta_display_stack_cmp (const void *a,
|
||||||
const void *b);
|
const void *b);
|
||||||
|
|
||||||
/* A given MetaWindow may have various X windows that "belong"
|
|
||||||
* to it, such as the frame window.
|
|
||||||
*/
|
|
||||||
MetaWindow* meta_display_lookup_x_window (MetaDisplay *display,
|
|
||||||
Window xwindow);
|
|
||||||
void meta_display_register_x_window (MetaDisplay *display,
|
|
||||||
Window *xwindowp,
|
|
||||||
MetaWindow *window);
|
|
||||||
void meta_display_unregister_x_window (MetaDisplay *display,
|
|
||||||
Window xwindow);
|
|
||||||
|
|
||||||
/* Each MetaWindow is uniquely identified by a 64-bit "stamp"; unlike a
|
/* Each MetaWindow is uniquely identified by a 64-bit "stamp"; unlike a
|
||||||
* a MetaWindow *, a stamp will never be recycled
|
* a MetaWindow *, a stamp will never be recycled
|
||||||
*/
|
*/
|
||||||
@@ -372,14 +305,6 @@ void meta_display_register_wayland_window (MetaDisplay *display,
|
|||||||
void meta_display_unregister_wayland_window (MetaDisplay *display,
|
void meta_display_unregister_wayland_window (MetaDisplay *display,
|
||||||
MetaWindow *window);
|
MetaWindow *window);
|
||||||
|
|
||||||
MetaWindow* meta_display_lookup_sync_alarm (MetaDisplay *display,
|
|
||||||
XSyncAlarm alarm);
|
|
||||||
void meta_display_register_sync_alarm (MetaDisplay *display,
|
|
||||||
XSyncAlarm *alarmp,
|
|
||||||
MetaWindow *window);
|
|
||||||
void meta_display_unregister_sync_alarm (MetaDisplay *display,
|
|
||||||
XSyncAlarm alarm);
|
|
||||||
|
|
||||||
void meta_display_notify_window_created (MetaDisplay *display,
|
void meta_display_notify_window_created (MetaDisplay *display,
|
||||||
MetaWindow *window);
|
MetaWindow *window);
|
||||||
|
|
||||||
@@ -389,10 +314,8 @@ GSList* meta_display_list_windows (MetaDisplay *display,
|
|||||||
MetaDisplay* meta_display_for_x_display (Display *xdisplay);
|
MetaDisplay* meta_display_for_x_display (Display *xdisplay);
|
||||||
MetaDisplay* meta_get_display (void);
|
MetaDisplay* meta_get_display (void);
|
||||||
|
|
||||||
Cursor meta_display_create_x_cursor (MetaDisplay *display,
|
void meta_display_reload_cursor (MetaDisplay *display);
|
||||||
MetaCursor cursor);
|
void meta_display_update_cursor (MetaDisplay *display);
|
||||||
|
|
||||||
void meta_display_update_cursor (MetaDisplay *display);
|
|
||||||
|
|
||||||
void meta_display_check_threshold_reached (MetaDisplay *display,
|
void meta_display_check_threshold_reached (MetaDisplay *display,
|
||||||
int x,
|
int x,
|
||||||
@@ -410,11 +333,6 @@ void meta_display_ungrab_focus_window_button (MetaDisplay *display,
|
|||||||
/* Next function is defined in edge-resistance.c */
|
/* Next function is defined in edge-resistance.c */
|
||||||
void meta_display_cleanup_edges (MetaDisplay *display);
|
void meta_display_cleanup_edges (MetaDisplay *display);
|
||||||
|
|
||||||
/* make a request to ensure the event serial has changed */
|
|
||||||
void meta_display_increment_event_serial (MetaDisplay *display);
|
|
||||||
|
|
||||||
void meta_display_update_active_window_hint (MetaDisplay *display);
|
|
||||||
|
|
||||||
/* utility goo */
|
/* utility goo */
|
||||||
const char* meta_event_mode_to_string (int m);
|
const char* meta_event_mode_to_string (int m);
|
||||||
const char* meta_event_detail_to_string (int d);
|
const char* meta_event_detail_to_string (int d);
|
||||||
@@ -448,16 +366,6 @@ void meta_display_accelerator_activate (MetaDisplay *display,
|
|||||||
ClutterKeyEvent *event);
|
ClutterKeyEvent *event);
|
||||||
gboolean meta_display_modifiers_accelerator_activate (MetaDisplay *display);
|
gboolean meta_display_modifiers_accelerator_activate (MetaDisplay *display);
|
||||||
|
|
||||||
#ifdef HAVE_XI23
|
|
||||||
gboolean meta_display_process_barrier_xevent (MetaDisplay *display,
|
|
||||||
XIEvent *event);
|
|
||||||
#endif /* HAVE_XI23 */
|
|
||||||
|
|
||||||
void meta_display_set_input_focus_xwindow (MetaDisplay *display,
|
|
||||||
MetaScreen *screen,
|
|
||||||
Window window,
|
|
||||||
guint32 timestamp);
|
|
||||||
|
|
||||||
void meta_display_sync_wayland_input_focus (MetaDisplay *display);
|
void meta_display_sync_wayland_input_focus (MetaDisplay *display);
|
||||||
void meta_display_update_focus_window (MetaDisplay *display,
|
void meta_display_update_focus_window (MetaDisplay *display,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
@@ -485,17 +393,12 @@ gboolean meta_display_show_resize_popup (MetaDisplay *display,
|
|||||||
int display_w,
|
int display_w,
|
||||||
int display_h);
|
int display_h);
|
||||||
|
|
||||||
void meta_restart_init (void);
|
void meta_set_is_restart (gboolean whether);
|
||||||
void meta_restart_finish (void);
|
|
||||||
|
|
||||||
void meta_display_cancel_touch (MetaDisplay *display);
|
void meta_display_cancel_touch (MetaDisplay *display);
|
||||||
|
|
||||||
gboolean meta_display_windows_are_interactable (MetaDisplay *display);
|
gboolean meta_display_windows_are_interactable (MetaDisplay *display);
|
||||||
|
|
||||||
void meta_display_set_alarm_filter (MetaDisplay *display,
|
|
||||||
MetaAlarmFilter filter,
|
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
void meta_display_show_tablet_mapping_notification (MetaDisplay *display,
|
void meta_display_show_tablet_mapping_notification (MetaDisplay *display,
|
||||||
ClutterInputDevice *pad,
|
ClutterInputDevice *pad,
|
||||||
const gchar *pretty_name);
|
const gchar *pretty_name);
|
||||||
@@ -507,4 +410,25 @@ void meta_display_notify_pad_group_switch (MetaDisplay *display,
|
|||||||
guint n_mode,
|
guint n_mode,
|
||||||
guint n_modes);
|
guint n_modes);
|
||||||
|
|
||||||
|
void meta_display_foreach_window (MetaDisplay *display,
|
||||||
|
MetaListWindowsFlags flags,
|
||||||
|
MetaDisplayWindowFunc func,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
|
void meta_display_restacked (MetaDisplay *display);
|
||||||
|
|
||||||
|
|
||||||
|
void meta_display_update_tile_preview (MetaDisplay *display,
|
||||||
|
gboolean delay);
|
||||||
|
void meta_display_hide_tile_preview (MetaDisplay *display);
|
||||||
|
|
||||||
|
gboolean meta_display_apply_startup_properties (MetaDisplay *display,
|
||||||
|
MetaWindow *window);
|
||||||
|
|
||||||
|
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
|
#endif
|
||||||
|
|||||||
1887
src/core/display.c
1887
src/core/display.c
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@
|
|||||||
#include "edge-resistance.h"
|
#include "edge-resistance.h"
|
||||||
#include "boxes-private.h"
|
#include "boxes-private.h"
|
||||||
#include "display-private.h"
|
#include "display-private.h"
|
||||||
|
#include "meta-workspace-manager-private.h"
|
||||||
#include "workspace-private.h"
|
#include "workspace-private.h"
|
||||||
|
|
||||||
/* A simple macro for whether a given window's edges are potentially
|
/* A simple macro for whether a given window's edges are potentially
|
||||||
@@ -955,6 +956,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
|
|||||||
* in the layer that we are working on
|
* in the layer that we are working on
|
||||||
*/
|
*/
|
||||||
GSList *rem_windows, *rem_win_stacking;
|
GSList *rem_windows, *rem_win_stacking;
|
||||||
|
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
|
||||||
|
|
||||||
g_assert (display->grab_window != NULL);
|
g_assert (display->grab_window != NULL);
|
||||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||||
@@ -965,8 +967,8 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
|
|||||||
* 1st: Get the list of relevant windows, from bottom to top
|
* 1st: Get the list of relevant windows, from bottom to top
|
||||||
*/
|
*/
|
||||||
stacked_windows =
|
stacked_windows =
|
||||||
meta_stack_list_windows (display->screen->stack,
|
meta_stack_list_windows (display->stack,
|
||||||
display->screen->active_workspace);
|
workspace_manager->active_workspace);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 2nd: we need to separate that stacked list into a list of windows that
|
* 2nd: we need to separate that stacked list into a list of windows that
|
||||||
@@ -1020,14 +1022,17 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
|
|||||||
{
|
{
|
||||||
GList *new_edges;
|
GList *new_edges;
|
||||||
MetaEdge *new_edge;
|
MetaEdge *new_edge;
|
||||||
|
MetaRectangle display_rect;
|
||||||
MetaRectangle reduced;
|
MetaRectangle reduced;
|
||||||
|
|
||||||
|
meta_display_get_size (display, &display_rect.width, &display_rect.height);
|
||||||
|
|
||||||
/* We don't care about snapping to any portion of the window that
|
/* We don't care about snapping to any portion of the window that
|
||||||
* is offscreen (we also don't care about parts of edges covered
|
* is offscreen (we also don't care about parts of edges covered
|
||||||
* by other windows or DOCKS, but that's handled below).
|
* by other windows or DOCKS, but that's handled below).
|
||||||
*/
|
*/
|
||||||
meta_rectangle_intersect (&cur_rect,
|
meta_rectangle_intersect (&cur_rect,
|
||||||
&display->screen->rect,
|
&display_rect,
|
||||||
&reduced);
|
&reduced);
|
||||||
|
|
||||||
new_edges = NULL;
|
new_edges = NULL;
|
||||||
@@ -1124,8 +1129,8 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
|
|||||||
*/
|
*/
|
||||||
cache_edges (display,
|
cache_edges (display,
|
||||||
edges,
|
edges,
|
||||||
display->screen->active_workspace->monitor_edges,
|
workspace_manager->active_workspace->monitor_edges,
|
||||||
display->screen->active_workspace->screen_edges);
|
workspace_manager->active_workspace->screen_edges);
|
||||||
g_list_free (edges);
|
g_list_free (edges);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ meta_display_handle_event (MetaDisplay *display,
|
|||||||
event->type == CLUTTER_BUTTON_PRESS ||
|
event->type == CLUTTER_BUTTON_PRESS ||
|
||||||
event->type == CLUTTER_TOUCH_BEGIN))
|
event->type == CLUTTER_TOUCH_BEGIN))
|
||||||
{
|
{
|
||||||
if (CurrentTime == display->current_time)
|
if (META_CURRENT_TIME == display->current_time)
|
||||||
{
|
{
|
||||||
/* We can't use missing (i.e. invalid) timestamps to set user time,
|
/* We can't use missing (i.e. invalid) timestamps to set user time,
|
||||||
* nor do we want to use them to sanity check other timestamps.
|
* nor do we want to use them to sanity check other timestamps.
|
||||||
@@ -417,7 +417,7 @@ meta_display_handle_event (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
display->current_time = CurrentTime;
|
display->current_time = META_CURRENT_TIME;
|
||||||
return bypass_clutter;
|
return bypass_clutter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,10 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include "bell.h"
|
#include "bell.h"
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "keybindings-private.h"
|
#include "keybindings-private.h"
|
||||||
#include "backends/x11/meta-backend-x11.h"
|
#include "backends/x11/meta-backend-x11.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
#define EVENT_MASK (SubstructureRedirectMask | \
|
#define EVENT_MASK (SubstructureRedirectMask | \
|
||||||
StructureNotifyMask | SubstructureNotifyMask | \
|
StructureNotifyMask | SubstructureNotifyMask | \
|
||||||
@@ -38,10 +39,13 @@ meta_window_ensure_frame (MetaWindow *window)
|
|||||||
MetaFrame *frame;
|
MetaFrame *frame;
|
||||||
XSetWindowAttributes attrs;
|
XSetWindowAttributes attrs;
|
||||||
gulong create_serial;
|
gulong create_serial;
|
||||||
|
MetaX11Display *x11_display;
|
||||||
|
|
||||||
if (window->frame)
|
if (window->frame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
x11_display = window->display->x11_display;
|
||||||
|
|
||||||
frame = g_new (MetaFrame, 1);
|
frame = g_new (MetaFrame, 1);
|
||||||
|
|
||||||
frame->window = window;
|
frame->window = window;
|
||||||
@@ -61,8 +65,8 @@ meta_window_ensure_frame (MetaWindow *window)
|
|||||||
frame->rect.x, frame->rect.y,
|
frame->rect.x, frame->rect.y,
|
||||||
frame->rect.width, frame->rect.height);
|
frame->rect.width, frame->rect.height);
|
||||||
|
|
||||||
frame->ui_frame = meta_ui_create_frame (window->screen->ui,
|
frame->ui_frame = meta_ui_create_frame (x11_display->ui,
|
||||||
window->display->xdisplay,
|
x11_display->xdisplay,
|
||||||
frame->window,
|
frame->window,
|
||||||
window->xvisual,
|
window->xvisual,
|
||||||
frame->rect.x,
|
frame->rect.x,
|
||||||
@@ -72,18 +76,18 @@ meta_window_ensure_frame (MetaWindow *window)
|
|||||||
&create_serial);
|
&create_serial);
|
||||||
frame->xwindow = frame->ui_frame->xwindow;
|
frame->xwindow = frame->ui_frame->xwindow;
|
||||||
|
|
||||||
meta_stack_tracker_record_add (window->screen->stack_tracker,
|
meta_stack_tracker_record_add (window->display->stack_tracker,
|
||||||
frame->xwindow,
|
frame->xwindow,
|
||||||
create_serial);
|
create_serial);
|
||||||
|
|
||||||
meta_verbose ("Frame for %s is 0x%lx\n", frame->window->desc, frame->xwindow);
|
meta_verbose ("Frame for %s is 0x%lx\n", frame->window->desc, frame->xwindow);
|
||||||
attrs.event_mask = EVENT_MASK;
|
attrs.event_mask = EVENT_MASK;
|
||||||
XChangeWindowAttributes (window->display->xdisplay,
|
XChangeWindowAttributes (x11_display->xdisplay,
|
||||||
frame->xwindow, CWEventMask, &attrs);
|
frame->xwindow, CWEventMask, &attrs);
|
||||||
|
|
||||||
meta_display_register_x_window (window->display, &frame->xwindow, window);
|
meta_x11_display_register_x_window (x11_display, &frame->xwindow, window);
|
||||||
|
|
||||||
meta_error_trap_push (window->display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
if (window->mapped)
|
if (window->mapped)
|
||||||
{
|
{
|
||||||
window->mapped = FALSE; /* the reparent will unmap the window,
|
window->mapped = FALSE; /* the reparent will unmap the window,
|
||||||
@@ -94,16 +98,16 @@ meta_window_ensure_frame (MetaWindow *window)
|
|||||||
window->unmaps_pending += 1;
|
window->unmaps_pending += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_stack_tracker_record_remove (window->screen->stack_tracker,
|
meta_stack_tracker_record_remove (window->display->stack_tracker,
|
||||||
window->xwindow,
|
window->xwindow,
|
||||||
XNextRequest (window->display->xdisplay));
|
XNextRequest (x11_display->xdisplay));
|
||||||
XReparentWindow (window->display->xdisplay,
|
XReparentWindow (x11_display->xdisplay,
|
||||||
window->xwindow,
|
window->xwindow,
|
||||||
frame->xwindow,
|
frame->xwindow,
|
||||||
frame->child_x,
|
frame->child_x,
|
||||||
frame->child_y);
|
frame->child_y);
|
||||||
/* FIXME handle this error */
|
/* FIXME handle this error */
|
||||||
meta_error_trap_pop (window->display);
|
meta_x11_error_trap_pop (x11_display);
|
||||||
|
|
||||||
/* stick frame to the window */
|
/* stick frame to the window */
|
||||||
window->frame = frame;
|
window->frame = frame;
|
||||||
@@ -114,7 +118,7 @@ meta_window_ensure_frame (MetaWindow *window)
|
|||||||
meta_frame_update_style (frame);
|
meta_frame_update_style (frame);
|
||||||
meta_frame_update_title (frame);
|
meta_frame_update_title (frame);
|
||||||
|
|
||||||
meta_ui_map_frame (frame->window->screen->ui, frame->xwindow);
|
meta_ui_map_frame (x11_display->ui, frame->xwindow);
|
||||||
|
|
||||||
{
|
{
|
||||||
MetaBackend *backend = meta_get_backend ();
|
MetaBackend *backend = meta_get_backend ();
|
||||||
@@ -125,7 +129,7 @@ meta_window_ensure_frame (MetaWindow *window)
|
|||||||
/* Since the backend selects for events on another connection,
|
/* Since the backend selects for events on another connection,
|
||||||
* make sure to sync the GTK+ connection to ensure that the
|
* make sure to sync the GTK+ connection to ensure that the
|
||||||
* frame window has been created on the server at this point. */
|
* frame window has been created on the server at this point. */
|
||||||
XSync (window->display->xdisplay, False);
|
XSync (x11_display->xdisplay, False);
|
||||||
|
|
||||||
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
||||||
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
||||||
@@ -152,10 +156,13 @@ meta_window_destroy_frame (MetaWindow *window)
|
|||||||
{
|
{
|
||||||
MetaFrame *frame;
|
MetaFrame *frame;
|
||||||
MetaFrameBorders borders;
|
MetaFrameBorders borders;
|
||||||
|
MetaX11Display *x11_display;
|
||||||
|
|
||||||
if (window->frame == NULL)
|
if (window->frame == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
x11_display = window->display->x11_display;
|
||||||
|
|
||||||
meta_verbose ("Unframing window %s\n", window->desc);
|
meta_verbose ("Unframing window %s\n", window->desc);
|
||||||
|
|
||||||
frame = window->frame;
|
frame = window->frame;
|
||||||
@@ -167,7 +174,7 @@ meta_window_destroy_frame (MetaWindow *window)
|
|||||||
/* Unparent the client window; it may be destroyed,
|
/* Unparent the client window; it may be destroyed,
|
||||||
* thus the error trap.
|
* thus the error trap.
|
||||||
*/
|
*/
|
||||||
meta_error_trap_push (window->display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
if (window->mapped)
|
if (window->mapped)
|
||||||
{
|
{
|
||||||
window->mapped = FALSE; /* Keep track of unmapping it, so we
|
window->mapped = FALSE; /* Keep track of unmapping it, so we
|
||||||
@@ -178,24 +185,23 @@ meta_window_destroy_frame (MetaWindow *window)
|
|||||||
"Incrementing unmaps_pending on %s for reparent back to root\n", window->desc);
|
"Incrementing unmaps_pending on %s for reparent back to root\n", window->desc);
|
||||||
window->unmaps_pending += 1;
|
window->unmaps_pending += 1;
|
||||||
}
|
}
|
||||||
meta_stack_tracker_record_add (window->screen->stack_tracker,
|
meta_stack_tracker_record_add (window->display->stack_tracker,
|
||||||
window->xwindow,
|
window->xwindow,
|
||||||
XNextRequest (window->display->xdisplay));
|
XNextRequest (x11_display->xdisplay));
|
||||||
XReparentWindow (window->display->xdisplay,
|
XReparentWindow (x11_display->xdisplay,
|
||||||
window->xwindow,
|
window->xwindow,
|
||||||
window->screen->xroot,
|
x11_display->xroot,
|
||||||
/* Using anything other than client root window coordinates
|
/* Using anything other than client root window coordinates
|
||||||
* coordinates here means we'll need to ensure a configure
|
* coordinates here means we'll need to ensure a configure
|
||||||
* notify event is sent; see bug 399552.
|
* notify event is sent; see bug 399552.
|
||||||
*/
|
*/
|
||||||
window->frame->rect.x + borders.invisible.left,
|
window->frame->rect.x + borders.invisible.left,
|
||||||
window->frame->rect.y + borders.invisible.top);
|
window->frame->rect.y + borders.invisible.top);
|
||||||
meta_error_trap_pop (window->display);
|
meta_x11_error_trap_pop (x11_display);
|
||||||
|
|
||||||
meta_ui_frame_unmanage (frame->ui_frame);
|
meta_ui_frame_unmanage (frame->ui_frame);
|
||||||
|
|
||||||
meta_display_unregister_x_window (window->display,
|
meta_x11_display_unregister_x_window (x11_display, frame->xwindow);
|
||||||
frame->xwindow);
|
|
||||||
|
|
||||||
window->frame = NULL;
|
window->frame = NULL;
|
||||||
if (window->frame_bounds)
|
if (window->frame_bounds)
|
||||||
@@ -369,18 +375,22 @@ void
|
|||||||
meta_frame_set_screen_cursor (MetaFrame *frame,
|
meta_frame_set_screen_cursor (MetaFrame *frame,
|
||||||
MetaCursor cursor)
|
MetaCursor cursor)
|
||||||
{
|
{
|
||||||
|
MetaX11Display *x11_display;
|
||||||
Cursor xcursor;
|
Cursor xcursor;
|
||||||
if (cursor == frame->current_cursor)
|
if (cursor == frame->current_cursor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
frame->current_cursor = cursor;
|
frame->current_cursor = cursor;
|
||||||
|
x11_display = frame->window->display->x11_display;
|
||||||
|
|
||||||
if (cursor == META_CURSOR_DEFAULT)
|
if (cursor == META_CURSOR_DEFAULT)
|
||||||
XUndefineCursor (frame->window->display->xdisplay, frame->xwindow);
|
XUndefineCursor (x11_display->xdisplay, frame->xwindow);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xcursor = meta_display_create_x_cursor (frame->window->display, cursor);
|
xcursor = meta_x11_display_create_x_cursor (x11_display, cursor);
|
||||||
XDefineCursor (frame->window->display->xdisplay, frame->xwindow, xcursor);
|
XDefineCursor (x11_display->xdisplay, frame->xwindow, xcursor);
|
||||||
XFlush (frame->window->display->xdisplay);
|
XFlush (x11_display->xdisplay);
|
||||||
XFreeCursor (frame->window->display->xdisplay, xcursor);
|
XFreeCursor (x11_display->xdisplay, xcursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,8 +114,6 @@ typedef struct
|
|||||||
|
|
||||||
void meta_display_init_keys (MetaDisplay *display);
|
void meta_display_init_keys (MetaDisplay *display);
|
||||||
void meta_display_shutdown_keys (MetaDisplay *display);
|
void meta_display_shutdown_keys (MetaDisplay *display);
|
||||||
void meta_screen_grab_keys (MetaScreen *screen);
|
|
||||||
void meta_screen_ungrab_keys (MetaScreen *screen);
|
|
||||||
void meta_window_grab_keys (MetaWindow *window);
|
void meta_window_grab_keys (MetaWindow *window);
|
||||||
void meta_window_ungrab_keys (MetaWindow *window);
|
void meta_window_ungrab_keys (MetaWindow *window);
|
||||||
gboolean meta_window_grab_all_keys (MetaWindow *window,
|
gboolean meta_window_grab_all_keys (MetaWindow *window,
|
||||||
@@ -139,4 +137,7 @@ GList *meta_prefs_get_keybindings (void);
|
|||||||
void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
|
void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
|
||||||
const char *meta_prefs_get_iso_next_group_option (void);
|
const char *meta_prefs_get_iso_next_group_option (void);
|
||||||
|
|
||||||
|
void meta_x11_display_grab_keys (MetaX11Display *x11_display);
|
||||||
|
void meta_x11_display_ungrab_keys (MetaX11Display *x11_display);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -29,12 +29,12 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "keybindings-private.h"
|
#include "keybindings-private.h"
|
||||||
|
#include "meta-workspace-manager-private.h"
|
||||||
#include "workspace-private.h"
|
#include "workspace-private.h"
|
||||||
#include <meta/compositor.h>
|
#include <meta/compositor.h>
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "edge-resistance.h"
|
#include "edge-resistance.h"
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include "screen-private.h"
|
|
||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
#include "meta-accel-parse.h"
|
#include "meta-accel-parse.h"
|
||||||
|
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
#include "backends/meta-monitor-manager-private.h"
|
#include "backends/meta-monitor-manager-private.h"
|
||||||
#include "backends/meta-logical-monitor.h"
|
#include "backends/meta-logical-monitor.h"
|
||||||
#include "backends/x11/meta-backend-x11.h"
|
#include "backends/x11/meta-backend-x11.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
#include "x11/window-x11.h"
|
#include "x11/window-x11.h"
|
||||||
|
|
||||||
#ifdef HAVE_NATIVE_BACKEND
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
@@ -165,17 +166,14 @@ meta_key_binding_is_builtin (MetaKeyBinding *binding)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static gboolean process_mouse_move_resize_grab (MetaDisplay *display,
|
static gboolean process_mouse_move_resize_grab (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event);
|
ClutterKeyEvent *event);
|
||||||
|
|
||||||
static gboolean process_keyboard_move_grab (MetaDisplay *display,
|
static gboolean process_keyboard_move_grab (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event);
|
ClutterKeyEvent *event);
|
||||||
|
|
||||||
static gboolean process_keyboard_resize_grab (MetaDisplay *display,
|
static gboolean process_keyboard_resize_grab (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event);
|
ClutterKeyEvent *event);
|
||||||
|
|
||||||
@@ -702,7 +700,8 @@ ungrab_key_bindings (MetaDisplay *display)
|
|||||||
{
|
{
|
||||||
GSList *windows, *l;
|
GSList *windows, *l;
|
||||||
|
|
||||||
meta_screen_ungrab_keys (display->screen);
|
if (display->x11_display)
|
||||||
|
meta_x11_display_ungrab_keys (display->x11_display);
|
||||||
|
|
||||||
windows = meta_display_list_windows (display, META_LIST_DEFAULT);
|
windows = meta_display_list_windows (display, META_LIST_DEFAULT);
|
||||||
for (l = windows; l; l = l->next)
|
for (l = windows; l; l = l->next)
|
||||||
@@ -719,7 +718,8 @@ grab_key_bindings (MetaDisplay *display)
|
|||||||
{
|
{
|
||||||
GSList *windows, *l;
|
GSList *windows, *l;
|
||||||
|
|
||||||
meta_screen_grab_keys (display->screen);
|
if (display->x11_display)
|
||||||
|
meta_x11_display_grab_keys (display->x11_display);
|
||||||
|
|
||||||
windows = meta_display_list_windows (display, META_LIST_DEFAULT);
|
windows = meta_display_list_windows (display, META_LIST_DEFAULT);
|
||||||
for (l = windows; l; l = l->next)
|
for (l = windows; l; l = l->next)
|
||||||
@@ -1297,42 +1297,44 @@ change_binding_keygrabs (MetaKeyBindingManager *keys,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_screen_change_keygrabs (MetaScreen *screen,
|
meta_x11_display_change_keygrabs (MetaX11Display *x11_display,
|
||||||
gboolean grab)
|
gboolean grab)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = screen->display;
|
MetaKeyBindingManager *keys = &x11_display->display->key_binding_manager;
|
||||||
MetaKeyBindingManager *keys = &display->key_binding_manager;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (keys->overlay_resolved_key_combo.len != 0)
|
if (keys->overlay_resolved_key_combo.len != 0)
|
||||||
meta_change_keygrab (keys, screen->xroot, grab, &keys->overlay_resolved_key_combo);
|
meta_change_keygrab (keys, x11_display->xroot,
|
||||||
|
grab, &keys->overlay_resolved_key_combo);
|
||||||
|
|
||||||
for (i = 0; i < keys->n_iso_next_group_combos; i++)
|
for (i = 0; i < keys->n_iso_next_group_combos; i++)
|
||||||
meta_change_keygrab (keys, screen->xroot, grab, &keys->iso_next_group_combo[i]);
|
meta_change_keygrab (keys, x11_display->xroot,
|
||||||
|
grab, &keys->iso_next_group_combo[i]);
|
||||||
|
|
||||||
change_binding_keygrabs (keys, screen->xroot, FALSE, grab);
|
change_binding_keygrabs (keys, x11_display->xroot,
|
||||||
|
FALSE, grab);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_screen_grab_keys (MetaScreen *screen)
|
meta_x11_display_grab_keys (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
if (screen->keys_grabbed)
|
if (x11_display->keys_grabbed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
meta_screen_change_keygrabs (screen, TRUE);
|
meta_x11_display_change_keygrabs (x11_display, TRUE);
|
||||||
|
|
||||||
screen->keys_grabbed = TRUE;
|
x11_display->keys_grabbed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_screen_ungrab_keys (MetaScreen *screen)
|
meta_x11_display_ungrab_keys (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
if (!screen->keys_grabbed)
|
if (!x11_display->keys_grabbed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
meta_screen_change_keygrabs (screen, FALSE);
|
meta_x11_display_change_keygrabs (x11_display, FALSE);
|
||||||
|
|
||||||
screen->keys_grabbed = FALSE;
|
x11_display->keys_grabbed = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1400,7 +1402,6 @@ meta_window_ungrab_keys (MetaWindow *window)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_external_grab (MetaDisplay *display,
|
handle_external_grab (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -1442,7 +1443,7 @@ meta_display_grab_accelerator (MetaDisplay *display,
|
|||||||
return META_KEYBINDING_ACTION_NONE;
|
return META_KEYBINDING_ACTION_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_change_keygrab (keys, display->screen->xroot, TRUE, &resolved_combo);
|
meta_change_keygrab (keys, display->x11_display->xroot, TRUE, &resolved_combo);
|
||||||
|
|
||||||
grab = g_new0 (MetaKeyGrab, 1);
|
grab = g_new0 (MetaKeyGrab, 1);
|
||||||
grab->action = next_dynamic_keybinding_action ();
|
grab->action = next_dynamic_keybinding_action ();
|
||||||
@@ -1486,7 +1487,8 @@ meta_display_ungrab_accelerator (MetaDisplay *display,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
meta_change_keygrab (keys, display->screen->xroot, FALSE, &binding->resolved_combo);
|
meta_change_keygrab (keys, display->x11_display->xroot,
|
||||||
|
FALSE, &binding->resolved_combo);
|
||||||
|
|
||||||
for (i = 0; i < binding->resolved_combo.len; i++)
|
for (i = 0; i < binding->resolved_combo.len; i++)
|
||||||
{
|
{
|
||||||
@@ -1676,21 +1678,20 @@ is_modifier (xkb_keysym_t keysym)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
invoke_handler (MetaDisplay *display,
|
invoke_handler (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaKeyHandler *handler,
|
MetaKeyHandler *handler,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding)
|
MetaKeyBinding *binding)
|
||||||
{
|
{
|
||||||
if (handler->func)
|
if (handler->func)
|
||||||
(* handler->func) (display, screen,
|
(* handler->func) (display,
|
||||||
handler->flags & META_KEY_BINDING_PER_WINDOW ?
|
handler->flags & META_KEY_BINDING_PER_WINDOW ?
|
||||||
window : NULL,
|
window : NULL,
|
||||||
event,
|
event,
|
||||||
binding,
|
binding,
|
||||||
handler->user_data);
|
handler->user_data);
|
||||||
else
|
else
|
||||||
(* handler->default_func) (display, screen,
|
(* handler->default_func) (display,
|
||||||
handler->flags & META_KEY_BINDING_PER_WINDOW ?
|
handler->flags & META_KEY_BINDING_PER_WINDOW ?
|
||||||
window: NULL,
|
window: NULL,
|
||||||
event,
|
event,
|
||||||
@@ -1700,7 +1701,6 @@ invoke_handler (MetaDisplay *display,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
process_event (MetaDisplay *display,
|
process_event (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event)
|
ClutterKeyEvent *event)
|
||||||
{
|
{
|
||||||
@@ -1750,7 +1750,7 @@ process_event (MetaDisplay *display,
|
|||||||
*/
|
*/
|
||||||
display->allow_terminal_deactivation = TRUE;
|
display->allow_terminal_deactivation = TRUE;
|
||||||
|
|
||||||
invoke_handler (display, screen, binding->handler, window, event, binding);
|
invoke_handler (display, binding->handler, window, event, binding);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
@@ -1762,7 +1762,6 @@ process_event (MetaDisplay *display,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
process_overlay_key (MetaDisplay *display,
|
process_overlay_key (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
@@ -1794,7 +1793,7 @@ process_overlay_key (MetaDisplay *display,
|
|||||||
* the event. Other clients with global grabs will be out of
|
* the event. Other clients with global grabs will be out of
|
||||||
* luck.
|
* luck.
|
||||||
*/
|
*/
|
||||||
if (process_event (display, screen, window, event))
|
if (process_event (display, window, event))
|
||||||
{
|
{
|
||||||
/* As normally, after we've handled a global key
|
/* As normally, after we've handled a global key
|
||||||
* binding, we unfreeze the keyboard but keep the grab
|
* binding, we unfreeze the keyboard but keep the grab
|
||||||
@@ -1879,7 +1878,6 @@ process_overlay_key (MetaDisplay *display,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
process_iso_next_group (MetaDisplay *display,
|
process_iso_next_group (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
ClutterKeyEvent *event)
|
ClutterKeyEvent *event)
|
||||||
{
|
{
|
||||||
MetaKeyBindingManager *keys = &display->key_binding_manager;
|
MetaKeyBindingManager *keys = &display->key_binding_manager;
|
||||||
@@ -1923,20 +1921,15 @@ process_key_event (MetaDisplay *display,
|
|||||||
gboolean keep_grab;
|
gboolean keep_grab;
|
||||||
gboolean all_keys_grabbed;
|
gboolean all_keys_grabbed;
|
||||||
gboolean handled;
|
gboolean handled;
|
||||||
MetaScreen *screen;
|
|
||||||
|
|
||||||
/* window may be NULL */
|
|
||||||
|
|
||||||
screen = display->screen;
|
|
||||||
|
|
||||||
all_keys_grabbed = window ? window->all_keys_grabbed : FALSE;
|
all_keys_grabbed = window ? window->all_keys_grabbed : FALSE;
|
||||||
if (!all_keys_grabbed)
|
if (!all_keys_grabbed)
|
||||||
{
|
{
|
||||||
handled = process_overlay_key (display, screen, event, window);
|
handled = process_overlay_key (display, event, window);
|
||||||
if (handled)
|
if (handled)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
handled = process_iso_next_group (display, screen, event);
|
handled = process_iso_next_group (display, event);
|
||||||
if (handled)
|
if (handled)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -1970,20 +1963,20 @@ process_key_event (MetaDisplay *display,
|
|||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||||
"Processing event for keyboard move\n");
|
"Processing event for keyboard move\n");
|
||||||
keep_grab = process_keyboard_move_grab (display, screen, window, event);
|
keep_grab = process_keyboard_move_grab (display, window, event);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||||
"Processing event for keyboard resize\n");
|
"Processing event for keyboard resize\n");
|
||||||
keep_grab = process_keyboard_resize_grab (display, screen, window, event);
|
keep_grab = process_keyboard_resize_grab (display, window, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||||
"Processing event for mouse-only move/resize\n");
|
"Processing event for mouse-only move/resize\n");
|
||||||
keep_grab = process_mouse_move_resize_grab (display, screen, window, event);
|
keep_grab = process_mouse_move_resize_grab (display, window, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!keep_grab)
|
if (!keep_grab)
|
||||||
@@ -1993,7 +1986,7 @@ process_key_event (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Do the normal keybindings */
|
/* Do the normal keybindings */
|
||||||
return process_event (display, screen, window, event);
|
return process_event (display, window, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle a key event. May be called recursively: some key events cause
|
/* Handle a key event. May be called recursively: some key events cause
|
||||||
@@ -2035,7 +2028,6 @@ meta_keybindings_process_event (MetaDisplay *display,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
process_mouse_move_resize_grab (MetaDisplay *display,
|
process_mouse_move_resize_grab (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event)
|
ClutterKeyEvent *event)
|
||||||
{
|
{
|
||||||
@@ -2047,7 +2039,7 @@ process_mouse_move_resize_grab (MetaDisplay *display,
|
|||||||
{
|
{
|
||||||
/* Hide the tiling preview if necessary */
|
/* Hide the tiling preview if necessary */
|
||||||
if (window->tile_mode != META_TILE_NONE)
|
if (window->tile_mode != META_TILE_NONE)
|
||||||
meta_screen_hide_tile_preview (screen);
|
meta_display_hide_tile_preview (display);
|
||||||
|
|
||||||
/* Restore the original tile mode */
|
/* Restore the original tile mode */
|
||||||
window->tile_mode = display->grab_tile_mode;
|
window->tile_mode = display->grab_tile_mode;
|
||||||
@@ -2079,7 +2071,6 @@ process_mouse_move_resize_grab (MetaDisplay *display,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
process_keyboard_move_grab (MetaDisplay *display,
|
process_keyboard_move_grab (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event)
|
ClutterKeyEvent *event)
|
||||||
{
|
{
|
||||||
@@ -2196,7 +2187,6 @@ process_keyboard_move_grab (MetaDisplay *display,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
process_keyboard_resize_grab_op_change (MetaDisplay *display,
|
process_keyboard_resize_grab_op_change (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event)
|
ClutterKeyEvent *event)
|
||||||
{
|
{
|
||||||
@@ -2317,7 +2307,6 @@ process_keyboard_resize_grab_op_change (MetaDisplay *display,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
process_keyboard_resize_grab (MetaDisplay *display,
|
process_keyboard_resize_grab (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event)
|
ClutterKeyEvent *event)
|
||||||
{
|
{
|
||||||
@@ -2352,7 +2341,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process_keyboard_resize_grab_op_change (display, screen, window, event))
|
if (process_keyboard_resize_grab_op_change (display, window, event))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
width = window->rect.width;
|
width = window->rect.width;
|
||||||
@@ -2547,26 +2536,26 @@ process_keyboard_resize_grab (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_switch_to_last_workspace (MetaDisplay *display,
|
handle_switch_to_last_workspace (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *event_window,
|
MetaWindow *event_window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
gint target = meta_screen_get_n_workspaces(screen) - 1;
|
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
|
||||||
MetaWorkspace *workspace = meta_screen_get_workspace_by_index (screen, target);
|
gint target = meta_workspace_manager_get_n_workspaces (workspace_manager) - 1;
|
||||||
|
MetaWorkspace *workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, target);
|
||||||
meta_workspace_activate (workspace, event->time);
|
meta_workspace_activate (workspace, event->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_switch_to_workspace (MetaDisplay *display,
|
handle_switch_to_workspace (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *event_window,
|
MetaWindow *event_window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
gint which = binding->handler->data;
|
gint which = binding->handler->data;
|
||||||
|
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
|
||||||
MetaWorkspace *workspace;
|
MetaWorkspace *workspace;
|
||||||
|
|
||||||
if (which < 0)
|
if (which < 0)
|
||||||
@@ -2575,12 +2564,12 @@ handle_switch_to_workspace (MetaDisplay *display,
|
|||||||
* current workspace.
|
* current workspace.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
workspace = meta_workspace_get_neighbor (screen->active_workspace,
|
workspace = meta_workspace_get_neighbor (workspace_manager->active_workspace,
|
||||||
which);
|
which);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
workspace = meta_screen_get_workspace_by_index (screen, which);
|
workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, which);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workspace)
|
if (workspace)
|
||||||
@@ -2596,7 +2585,6 @@ handle_switch_to_workspace (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_maximize_vertically (MetaDisplay *display,
|
handle_maximize_vertically (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -2613,7 +2601,6 @@ handle_maximize_vertically (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_maximize_horizontally (MetaDisplay *display,
|
handle_maximize_horizontally (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -2630,7 +2617,6 @@ handle_maximize_horizontally (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_always_on_top (MetaDisplay *display,
|
handle_always_on_top (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -2644,7 +2630,6 @@ handle_always_on_top (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_corner_backend (MetaDisplay *display,
|
handle_move_to_corner_backend (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
int gravity)
|
int gravity)
|
||||||
{
|
{
|
||||||
@@ -2703,95 +2688,86 @@ handle_move_to_corner_backend (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_corner_nw (MetaDisplay *display,
|
handle_move_to_corner_nw (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
handle_move_to_corner_backend (display, screen, window, NorthWestGravity);
|
handle_move_to_corner_backend (display, window, NorthWestGravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_corner_ne (MetaDisplay *display,
|
handle_move_to_corner_ne (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
handle_move_to_corner_backend (display, screen, window, NorthEastGravity);
|
handle_move_to_corner_backend (display, window, NorthEastGravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_corner_sw (MetaDisplay *display,
|
handle_move_to_corner_sw (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
handle_move_to_corner_backend (display, screen, window, SouthWestGravity);
|
handle_move_to_corner_backend (display, window, SouthWestGravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_corner_se (MetaDisplay *display,
|
handle_move_to_corner_se (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
handle_move_to_corner_backend (display, screen, window, SouthEastGravity);
|
handle_move_to_corner_backend (display, window, SouthEastGravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_side_n (MetaDisplay *display,
|
handle_move_to_side_n (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
handle_move_to_corner_backend (display, screen, window, NorthGravity);
|
handle_move_to_corner_backend (display, window, NorthGravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_side_s (MetaDisplay *display,
|
handle_move_to_side_s (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
handle_move_to_corner_backend (display, screen, window, SouthGravity);
|
handle_move_to_corner_backend (display, window, SouthGravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_side_e (MetaDisplay *display,
|
handle_move_to_side_e (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
handle_move_to_corner_backend (display, screen, window, EastGravity);
|
handle_move_to_corner_backend (display, window, EastGravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_side_w (MetaDisplay *display,
|
handle_move_to_side_w (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
handle_move_to_corner_backend (display, screen, window, WestGravity);
|
handle_move_to_corner_backend (display, window, WestGravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_center (MetaDisplay *display,
|
handle_move_to_center (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -2811,32 +2787,33 @@ handle_move_to_center (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_show_desktop (MetaDisplay *display,
|
handle_show_desktop (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
if (screen->active_workspace->showing_desktop)
|
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
|
||||||
|
|
||||||
|
if (workspace_manager->active_workspace->showing_desktop)
|
||||||
{
|
{
|
||||||
meta_screen_unshow_desktop (screen);
|
meta_workspace_manager_unshow_desktop (workspace_manager);
|
||||||
meta_workspace_focus_default_window (screen->active_workspace,
|
meta_workspace_focus_default_window (workspace_manager->active_workspace,
|
||||||
NULL,
|
NULL,
|
||||||
event->time);
|
event->time);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
meta_screen_show_desktop (screen, event->time);
|
meta_workspace_manager_show_desktop (workspace_manager, event->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_panel (MetaDisplay *display,
|
handle_panel (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
MetaKeyBindingAction action = binding->handler->data;
|
MetaKeyBindingAction action = binding->handler->data;
|
||||||
|
MetaX11Display *x11_display = display->x11_display;
|
||||||
Atom action_atom;
|
Atom action_atom;
|
||||||
XClientMessageEvent ev;
|
XClientMessageEvent ev;
|
||||||
|
|
||||||
@@ -2845,18 +2822,18 @@ handle_panel (MetaDisplay *display,
|
|||||||
{
|
{
|
||||||
/* FIXME: The numbers are wrong */
|
/* FIXME: The numbers are wrong */
|
||||||
case META_KEYBINDING_ACTION_PANEL_MAIN_MENU:
|
case META_KEYBINDING_ACTION_PANEL_MAIN_MENU:
|
||||||
action_atom = display->atom__GNOME_PANEL_ACTION_MAIN_MENU;
|
action_atom = x11_display->atom__GNOME_PANEL_ACTION_MAIN_MENU;
|
||||||
break;
|
break;
|
||||||
case META_KEYBINDING_ACTION_PANEL_RUN_DIALOG:
|
case META_KEYBINDING_ACTION_PANEL_RUN_DIALOG:
|
||||||
action_atom = display->atom__GNOME_PANEL_ACTION_RUN_DIALOG;
|
action_atom = x11_display->atom__GNOME_PANEL_ACTION_RUN_DIALOG;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ev.type = ClientMessage;
|
ev.type = ClientMessage;
|
||||||
ev.window = screen->xroot;
|
ev.window = x11_display->xroot;
|
||||||
ev.message_type = display->atom__GNOME_PANEL_ACTION;
|
ev.message_type = x11_display->atom__GNOME_PANEL_ACTION;
|
||||||
ev.format = 32;
|
ev.format = 32;
|
||||||
ev.data.l[0] = action_atom;
|
ev.data.l[0] = action_atom;
|
||||||
ev.data.l[1] = event->time;
|
ev.data.l[1] = event->time;
|
||||||
@@ -2866,23 +2843,22 @@ handle_panel (MetaDisplay *display,
|
|||||||
"off due to keybinding press\n", event->time);
|
"off due to keybinding press\n", event->time);
|
||||||
display->mouse_mode = FALSE;
|
display->mouse_mode = FALSE;
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
|
|
||||||
/* Release the grab for the panel before sending the event */
|
/* Release the grab for the panel before sending the event */
|
||||||
XUngrabKeyboard (display->xdisplay, event->time);
|
XUngrabKeyboard (x11_display->xdisplay, event->time);
|
||||||
|
|
||||||
XSendEvent (display->xdisplay,
|
XSendEvent (x11_display->xdisplay,
|
||||||
screen->xroot,
|
x11_display->xroot,
|
||||||
False,
|
False,
|
||||||
StructureNotifyMask,
|
StructureNotifyMask,
|
||||||
(XEvent*) &ev);
|
(XEvent*) &ev);
|
||||||
|
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_activate_window_menu (MetaDisplay *display,
|
handle_activate_window_menu (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *event_window,
|
MetaWindow *event_window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -2908,12 +2884,12 @@ handle_activate_window_menu (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
do_choose_window (MetaDisplay *display,
|
do_choose_window (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *event_window,
|
MetaWindow *event_window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gboolean backward)
|
gboolean backward)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
|
||||||
MetaTabList type = binding->handler->data;
|
MetaTabList type = binding->handler->data;
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
@@ -2922,7 +2898,7 @@ do_choose_window (MetaDisplay *display,
|
|||||||
|
|
||||||
window = meta_display_get_tab_next (display,
|
window = meta_display_get_tab_next (display,
|
||||||
type,
|
type,
|
||||||
screen->active_workspace,
|
workspace_manager->active_workspace,
|
||||||
NULL,
|
NULL,
|
||||||
backward);
|
backward);
|
||||||
|
|
||||||
@@ -2932,31 +2908,28 @@ do_choose_window (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_switch (MetaDisplay *display,
|
handle_switch (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *event_window,
|
MetaWindow *event_window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
gboolean backwards = meta_key_binding_is_reversed (binding);
|
gboolean backwards = meta_key_binding_is_reversed (binding);
|
||||||
do_choose_window (display, screen, event_window, event, binding, backwards);
|
do_choose_window (display, event_window, event, binding, backwards);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_cycle (MetaDisplay *display,
|
handle_cycle (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *event_window,
|
MetaWindow *event_window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
gboolean backwards = meta_key_binding_is_reversed (binding);
|
gboolean backwards = meta_key_binding_is_reversed (binding);
|
||||||
do_choose_window (display, screen, event_window, event, binding, backwards);
|
do_choose_window (display, event_window, event, binding, backwards);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_toggle_fullscreen (MetaDisplay *display,
|
handle_toggle_fullscreen (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -2970,7 +2943,6 @@ handle_toggle_fullscreen (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_toggle_above (MetaDisplay *display,
|
handle_toggle_above (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -2984,7 +2956,6 @@ handle_toggle_above (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_toggle_tiled (MetaDisplay *display,
|
handle_toggle_tiled (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3022,7 +2993,6 @@ handle_toggle_tiled (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_toggle_maximized (MetaDisplay *display,
|
handle_toggle_maximized (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3036,7 +3006,6 @@ handle_toggle_maximized (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_maximize (MetaDisplay *display,
|
handle_maximize (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3048,7 +3017,6 @@ handle_maximize (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_unmaximize (MetaDisplay *display,
|
handle_unmaximize (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3060,7 +3028,6 @@ handle_unmaximize (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_toggle_shaded (MetaDisplay *display,
|
handle_toggle_shaded (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3074,7 +3041,6 @@ handle_toggle_shaded (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_close (MetaDisplay *display,
|
handle_close (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3086,7 +3052,6 @@ handle_close (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_minimize (MetaDisplay *display,
|
handle_minimize (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3098,7 +3063,6 @@ handle_minimize (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_begin_move (MetaDisplay *display,
|
handle_begin_move (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3115,7 +3079,6 @@ handle_begin_move (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_begin_resize (MetaDisplay *display,
|
handle_begin_resize (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3132,7 +3095,6 @@ handle_begin_resize (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_toggle_on_all_workspaces (MetaDisplay *display,
|
handle_toggle_on_all_workspaces (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3146,32 +3108,32 @@ handle_toggle_on_all_workspaces (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_workspace_last (MetaDisplay *display,
|
handle_move_to_workspace_last (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
|
||||||
gint which;
|
gint which;
|
||||||
MetaWorkspace *workspace;
|
MetaWorkspace *workspace;
|
||||||
|
|
||||||
if (window->always_sticky)
|
if (window->always_sticky)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
which = meta_screen_get_n_workspaces (screen) - 1;
|
which = meta_workspace_manager_get_n_workspaces (workspace_manager) - 1;
|
||||||
workspace = meta_screen_get_workspace_by_index (screen, which);
|
workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, which);
|
||||||
meta_window_change_workspace (window, workspace);
|
meta_window_change_workspace (window, workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_workspace (MetaDisplay *display,
|
handle_move_to_workspace (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer dummy)
|
gpointer dummy)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
|
||||||
gint which = binding->handler->data;
|
gint which = binding->handler->data;
|
||||||
gboolean flip = (which < 0);
|
gboolean flip = (which < 0);
|
||||||
MetaWorkspace *workspace;
|
MetaWorkspace *workspace;
|
||||||
@@ -3190,12 +3152,12 @@ handle_move_to_workspace (MetaDisplay *display,
|
|||||||
workspace = NULL;
|
workspace = NULL;
|
||||||
if (flip)
|
if (flip)
|
||||||
{
|
{
|
||||||
workspace = meta_workspace_get_neighbor (screen->active_workspace,
|
workspace = meta_workspace_get_neighbor (workspace_manager->active_workspace,
|
||||||
which);
|
which);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
workspace = meta_screen_get_workspace_by_index (screen, which);
|
workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, which);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workspace)
|
if (workspace)
|
||||||
@@ -3207,7 +3169,7 @@ handle_move_to_workspace (MetaDisplay *display,
|
|||||||
meta_topic (META_DEBUG_FOCUS,
|
meta_topic (META_DEBUG_FOCUS,
|
||||||
"Resetting mouse_mode to FALSE due to "
|
"Resetting mouse_mode to FALSE due to "
|
||||||
"handle_move_to_workspace() call with flip set.\n");
|
"handle_move_to_workspace() call with flip set.\n");
|
||||||
meta_display_clear_mouse_mode (workspace->screen->display);
|
meta_display_clear_mouse_mode (workspace->display);
|
||||||
meta_workspace_activate_with_focus (workspace,
|
meta_workspace_activate_with_focus (workspace,
|
||||||
window,
|
window,
|
||||||
event->time);
|
event->time);
|
||||||
@@ -3221,7 +3183,6 @@ handle_move_to_workspace (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_move_to_monitor (MetaDisplay *display,
|
handle_move_to_monitor (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3245,7 +3206,6 @@ handle_move_to_monitor (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_raise_or_lower (MetaDisplay *display,
|
handle_raise_or_lower (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3256,7 +3216,7 @@ handle_raise_or_lower (MetaDisplay *display,
|
|||||||
MetaWindow *above = NULL;
|
MetaWindow *above = NULL;
|
||||||
|
|
||||||
/* Check if top */
|
/* Check if top */
|
||||||
if (meta_stack_get_top (window->screen->stack) == window)
|
if (meta_stack_get_top (window->display->stack) == window)
|
||||||
{
|
{
|
||||||
meta_window_lower (window);
|
meta_window_lower (window);
|
||||||
return;
|
return;
|
||||||
@@ -3264,7 +3224,7 @@ handle_raise_or_lower (MetaDisplay *display,
|
|||||||
|
|
||||||
/* else check if windows in same layer are intersecting it */
|
/* else check if windows in same layer are intersecting it */
|
||||||
|
|
||||||
above = meta_stack_get_above (window->screen->stack, window, TRUE);
|
above = meta_stack_get_above (window->display->stack, window, TRUE);
|
||||||
|
|
||||||
while (above)
|
while (above)
|
||||||
{
|
{
|
||||||
@@ -3283,7 +3243,7 @@ handle_raise_or_lower (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
above = meta_stack_get_above (window->screen->stack, above, TRUE);
|
above = meta_stack_get_above (window->display->stack, above, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* window is not obscured */
|
/* window is not obscured */
|
||||||
@@ -3292,7 +3252,6 @@ handle_raise_or_lower (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_raise (MetaDisplay *display,
|
handle_raise (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3303,7 +3262,6 @@ handle_raise (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_lower (MetaDisplay *display,
|
handle_lower (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3314,7 +3272,6 @@ handle_lower (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_set_spew_mark (MetaDisplay *display,
|
handle_set_spew_mark (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3326,7 +3283,6 @@ handle_set_spew_mark (MetaDisplay *display,
|
|||||||
#ifdef HAVE_NATIVE_BACKEND
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
static void
|
static void
|
||||||
handle_switch_vt (MetaDisplay *display,
|
handle_switch_vt (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3345,7 +3301,6 @@ handle_switch_vt (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_switch_monitor (MetaDisplay *display,
|
handle_switch_monitor (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3366,7 +3321,6 @@ handle_switch_monitor (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_rotate_monitor (MetaDisplay *display,
|
handle_rotate_monitor (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -3381,7 +3335,6 @@ handle_rotate_monitor (MetaDisplay *display,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_restore_shortcuts (MetaDisplay *display,
|
handle_restore_shortcuts (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
@@ -4024,28 +3977,28 @@ init_builtin_key_bindings (MetaDisplay *display)
|
|||||||
common_keybindings,
|
common_keybindings,
|
||||||
META_KEY_BINDING_PER_WINDOW,
|
META_KEY_BINDING_PER_WINDOW,
|
||||||
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_LEFT,
|
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_LEFT,
|
||||||
handle_move_to_monitor, META_SCREEN_LEFT);
|
handle_move_to_monitor, META_DISPLAY_LEFT);
|
||||||
|
|
||||||
add_builtin_keybinding (display,
|
add_builtin_keybinding (display,
|
||||||
"move-to-monitor-right",
|
"move-to-monitor-right",
|
||||||
common_keybindings,
|
common_keybindings,
|
||||||
META_KEY_BINDING_PER_WINDOW,
|
META_KEY_BINDING_PER_WINDOW,
|
||||||
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_RIGHT,
|
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_RIGHT,
|
||||||
handle_move_to_monitor, META_SCREEN_RIGHT);
|
handle_move_to_monitor, META_DISPLAY_RIGHT);
|
||||||
|
|
||||||
add_builtin_keybinding (display,
|
add_builtin_keybinding (display,
|
||||||
"move-to-monitor-down",
|
"move-to-monitor-down",
|
||||||
common_keybindings,
|
common_keybindings,
|
||||||
META_KEY_BINDING_PER_WINDOW,
|
META_KEY_BINDING_PER_WINDOW,
|
||||||
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_DOWN,
|
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_DOWN,
|
||||||
handle_move_to_monitor, META_SCREEN_DOWN);
|
handle_move_to_monitor, META_DISPLAY_DOWN);
|
||||||
|
|
||||||
add_builtin_keybinding (display,
|
add_builtin_keybinding (display,
|
||||||
"move-to-monitor-up",
|
"move-to-monitor-up",
|
||||||
common_keybindings,
|
common_keybindings,
|
||||||
META_KEY_BINDING_PER_WINDOW,
|
META_KEY_BINDING_PER_WINDOW,
|
||||||
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_UP,
|
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_UP,
|
||||||
handle_move_to_monitor, META_SCREEN_UP);
|
handle_move_to_monitor, META_DISPLAY_UP);
|
||||||
|
|
||||||
add_builtin_keybinding (display,
|
add_builtin_keybinding (display,
|
||||||
"raise-or-lower",
|
"raise-or-lower",
|
||||||
|
|||||||
@@ -31,4 +31,6 @@ typedef enum _MetaCompositorType
|
|||||||
void meta_override_compositor_configuration (MetaCompositorType compositor_type,
|
void meta_override_compositor_configuration (MetaCompositorType compositor_type,
|
||||||
GType backend_gtype);
|
GType backend_gtype);
|
||||||
|
|
||||||
|
gboolean meta_should_autostart_x11_display (void);
|
||||||
|
|
||||||
#endif /* META_MAIN_PRIVATE_H */
|
#endif /* META_MAIN_PRIVATE_H */
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
#include <meta/main.h>
|
#include <meta/main.h>
|
||||||
#include "util-private.h"
|
#include "util-private.h"
|
||||||
#include "display-private.h"
|
#include "display-private.h"
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
#include <meta/compositor.h>
|
#include <meta/compositor.h>
|
||||||
@@ -177,6 +177,7 @@ static gboolean opt_sync;
|
|||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
static gboolean opt_wayland;
|
static gboolean opt_wayland;
|
||||||
static gboolean opt_nested;
|
static gboolean opt_nested;
|
||||||
|
static gboolean opt_no_x11;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NATIVE_BACKEND
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
static gboolean opt_display_server;
|
static gboolean opt_display_server;
|
||||||
@@ -231,6 +232,12 @@ static GOptionEntry meta_options[] = {
|
|||||||
N_("Run as a nested compositor"),
|
N_("Run as a nested compositor"),
|
||||||
NULL
|
NULL
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"no-x11", 0, 0, G_OPTION_ARG_NONE,
|
||||||
|
&opt_no_x11,
|
||||||
|
N_("Run wayland compositor without starting Xwayland"),
|
||||||
|
NULL
|
||||||
|
},
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NATIVE_BACKEND
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
{
|
{
|
||||||
@@ -294,7 +301,7 @@ meta_finalize (void)
|
|||||||
|
|
||||||
if (display)
|
if (display)
|
||||||
meta_display_close (display,
|
meta_display_close (display,
|
||||||
CurrentTime); /* I doubt correct timestamps matter here */
|
META_CURRENT_TIME); /* I doubt correct timestamps matter here */
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
if (meta_is_wayland_compositor ())
|
if (meta_is_wayland_compositor ())
|
||||||
@@ -437,6 +444,12 @@ calculate_compositor_configuration (MetaCompositorType *compositor_type,
|
|||||||
run_as_wayland_compositor = check_for_wayland_session_type ();
|
run_as_wayland_compositor = check_for_wayland_session_type ();
|
||||||
#endif /* HAVE_NATIVE_BACKEND */
|
#endif /* HAVE_NATIVE_BACKEND */
|
||||||
|
|
||||||
|
if (!run_as_wayland_compositor && opt_no_x11)
|
||||||
|
{
|
||||||
|
meta_warning ("Can't disable X11 support on X11 compositor\n");
|
||||||
|
meta_exit (META_EXIT_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
if (run_as_wayland_compositor)
|
if (run_as_wayland_compositor)
|
||||||
*compositor_type = META_COMPOSITOR_TYPE_WAYLAND;
|
*compositor_type = META_COMPOSITOR_TYPE_WAYLAND;
|
||||||
else
|
else
|
||||||
@@ -583,10 +596,6 @@ meta_init (void)
|
|||||||
meta_fatal ("Can't specify both SM save file and SM client id\n");
|
meta_fatal ("Can't specify both SM save file and SM client id\n");
|
||||||
|
|
||||||
meta_main_loop = g_main_loop_new (NULL, FALSE);
|
meta_main_loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
|
||||||
meta_ui_init ();
|
|
||||||
|
|
||||||
meta_restart_init ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -697,3 +706,16 @@ prefs_changed_callback (MetaPreference pref,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_should_autostart_x11_display (void)
|
||||||
|
{
|
||||||
|
MetaBackend *backend = meta_get_backend ();
|
||||||
|
gboolean is_x11 = TRUE;
|
||||||
|
|
||||||
|
#ifdef HAVE_WAYLAND
|
||||||
|
is_x11 = !opt_no_x11;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return META_IS_BACKEND_X11_CM (backend) || is_x11;
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
#include <meta/meta-close-dialog.h>
|
#include <meta/meta-close-dialog.h>
|
||||||
#include "meta-close-dialog-default-private.h"
|
#include "meta-close-dialog-default-private.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
@@ -157,7 +158,7 @@ meta_close_dialog_default_show (MetaCloseDialog *dialog)
|
|||||||
dialog_pid =
|
dialog_pid =
|
||||||
meta_show_dialog ("--question",
|
meta_show_dialog ("--question",
|
||||||
window_content, NULL,
|
window_content, NULL,
|
||||||
window->screen->screen_name,
|
window->display->x11_display->screen_name,
|
||||||
_("_Force Quit"), _("_Wait"),
|
_("_Force Quit"), _("_Wait"),
|
||||||
"face-sad-symbolic", window->xwindow,
|
"face-sad-symbolic", window->xwindow,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|||||||
94
src/core/meta-workspace-manager-private.h
Normal file
94
src/core/meta-workspace-manager-private.h
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2001 Havoc Pennington
|
||||||
|
* Copyright (C) 2002, 2003, 2004 Red Hat, Inc.
|
||||||
|
* Copyright (C) 2003, 2004 Rob Adams
|
||||||
|
* Copyright (C) 2004-2006 Elijah Newren
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef META_WORKSPACE_MANAGER_PRIVATE_H
|
||||||
|
#define META_WORKSPACE_MANAGER_PRIVATE_H
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
|
#include "core/display-private.h"
|
||||||
|
#include "meta/common.h"
|
||||||
|
#include "meta/types.h"
|
||||||
|
#include "meta/meta-workspace-manager.h"
|
||||||
|
|
||||||
|
struct _MetaWorkspaceManager
|
||||||
|
{
|
||||||
|
GObject parent;
|
||||||
|
|
||||||
|
MetaDisplay *display;
|
||||||
|
MetaWorkspace *active_workspace;
|
||||||
|
|
||||||
|
GList *workspaces;
|
||||||
|
|
||||||
|
int rows_of_workspaces;
|
||||||
|
int columns_of_workspaces;
|
||||||
|
MetaDisplayCorner starting_corner;
|
||||||
|
guint vertical_workspaces : 1;
|
||||||
|
guint workspace_layout_overridden : 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
MetaWorkspaceManager *meta_workspace_manager_new (MetaDisplay *display);
|
||||||
|
|
||||||
|
void meta_workspace_manager_init_workspaces (MetaWorkspaceManager *workspace_manager);
|
||||||
|
void meta_workspace_manager_update_workspace_layout (MetaWorkspaceManager *workspace_manager,
|
||||||
|
MetaDisplayCorner starting_corner,
|
||||||
|
gboolean vertical_layout,
|
||||||
|
int n_rows,
|
||||||
|
int n_columns);
|
||||||
|
|
||||||
|
typedef struct MetaWorkspaceLayout MetaWorkspaceLayout;
|
||||||
|
|
||||||
|
struct MetaWorkspaceLayout
|
||||||
|
{
|
||||||
|
int rows;
|
||||||
|
int cols;
|
||||||
|
int *grid;
|
||||||
|
int grid_area;
|
||||||
|
int current_row;
|
||||||
|
int current_col;
|
||||||
|
};
|
||||||
|
|
||||||
|
void meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_manager,
|
||||||
|
int num_workspaces,
|
||||||
|
int current_space,
|
||||||
|
MetaWorkspaceLayout *layout);
|
||||||
|
|
||||||
|
void meta_workspace_manager_free_workspace_layout (MetaWorkspaceLayout *layout);
|
||||||
|
|
||||||
|
void meta_workspace_manager_minimize_all_on_active_workspace_except (MetaWorkspaceManager *workspace_manager,
|
||||||
|
MetaWindow *keep);
|
||||||
|
|
||||||
|
/* Show/hide the desktop (temporarily hide all windows) */
|
||||||
|
void meta_workspace_manager_show_desktop (MetaWorkspaceManager *workspace_manager,
|
||||||
|
guint32 timestamp);
|
||||||
|
void meta_workspace_manager_unshow_desktop (MetaWorkspaceManager *workspace_manager);
|
||||||
|
|
||||||
|
void meta_workspace_manager_workspace_switched (MetaWorkspaceManager *workspace_manager,
|
||||||
|
int from,
|
||||||
|
int to,
|
||||||
|
MetaMotionDirection direction);
|
||||||
|
|
||||||
|
void meta_workspace_manager_update_num_workspaces (MetaWorkspaceManager *workspace_manager,
|
||||||
|
guint32 timestamp,
|
||||||
|
int new_num);
|
||||||
|
|
||||||
|
#endif /* META_WORKSPACE_MANAGER_PRIVATE_H */
|
||||||
946
src/core/meta-workspace-manager.c
Normal file
946
src/core/meta-workspace-manager.c
Normal file
@@ -0,0 +1,946 @@
|
|||||||
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2001 Havoc Pennington
|
||||||
|
* Copyright (C) 2002, 2003, 2004 Red Hat, Inc.
|
||||||
|
* Copyright (C) 2003, 2004 Rob Adams
|
||||||
|
* Copyright (C) 2004-2006 Elijah Newren
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "core/meta-workspace-manager-private.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "backends/meta-backend-private.h"
|
||||||
|
|
||||||
|
#include "core/window-private.h"
|
||||||
|
#include "core/workspace-private.h"
|
||||||
|
|
||||||
|
#include "meta/meta-enum-types.h"
|
||||||
|
#include "meta/prefs.h"
|
||||||
|
#include "meta/util.h"
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (MetaWorkspaceManager, meta_workspace_manager, G_TYPE_OBJECT)
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
WORKSPACE_ADDED,
|
||||||
|
WORKSPACE_REMOVED,
|
||||||
|
WORKSPACE_SWITCHED,
|
||||||
|
ACTIVE_WORKSPACE_CHANGED,
|
||||||
|
SHOWING_DESKTOP_CHANGED,
|
||||||
|
LAST_SIGNAL
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
PROP_0,
|
||||||
|
|
||||||
|
PROP_N_WORKSPACES
|
||||||
|
};
|
||||||
|
|
||||||
|
static guint workspace_manager_signals [LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
|
static void prefs_changed_callback (MetaPreference pref,
|
||||||
|
void *data);
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_workspace_manager_get_property (GObject *object,
|
||||||
|
guint prop_id,
|
||||||
|
GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = META_WORKSPACE_MANAGER (object);
|
||||||
|
|
||||||
|
switch (prop_id)
|
||||||
|
{
|
||||||
|
case PROP_N_WORKSPACES:
|
||||||
|
g_value_set_int (value, meta_workspace_manager_get_n_workspaces (workspace_manager));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_workspace_manager_set_property (GObject *object,
|
||||||
|
guint prop_id,
|
||||||
|
const GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
switch (prop_id)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_workspace_manager_finalize (GObject *object)
|
||||||
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = META_WORKSPACE_MANAGER (object);
|
||||||
|
|
||||||
|
meta_prefs_remove_listener (prefs_changed_callback, workspace_manager);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (meta_workspace_manager_parent_class)->finalize (object);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_workspace_manager_class_init (MetaWorkspaceManagerClass *klass)
|
||||||
|
{
|
||||||
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
|
object_class->get_property = meta_workspace_manager_get_property;
|
||||||
|
object_class->set_property = meta_workspace_manager_set_property;
|
||||||
|
|
||||||
|
object_class->finalize = meta_workspace_manager_finalize;
|
||||||
|
|
||||||
|
workspace_manager_signals[WORKSPACE_ADDED] =
|
||||||
|
g_signal_new ("workspace-added",
|
||||||
|
G_TYPE_FROM_CLASS (klass),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
0, NULL, NULL, NULL,
|
||||||
|
G_TYPE_NONE,
|
||||||
|
1,
|
||||||
|
G_TYPE_INT);
|
||||||
|
|
||||||
|
workspace_manager_signals[WORKSPACE_REMOVED] =
|
||||||
|
g_signal_new ("workspace-removed",
|
||||||
|
G_TYPE_FROM_CLASS (klass),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
0, NULL, NULL, NULL,
|
||||||
|
G_TYPE_NONE,
|
||||||
|
1,
|
||||||
|
G_TYPE_INT);
|
||||||
|
|
||||||
|
workspace_manager_signals[WORKSPACE_SWITCHED] =
|
||||||
|
g_signal_new ("workspace-switched",
|
||||||
|
G_TYPE_FROM_CLASS (klass),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
0, NULL, NULL, NULL,
|
||||||
|
G_TYPE_NONE,
|
||||||
|
3,
|
||||||
|
G_TYPE_INT,
|
||||||
|
G_TYPE_INT,
|
||||||
|
META_TYPE_MOTION_DIRECTION);
|
||||||
|
|
||||||
|
workspace_manager_signals[ACTIVE_WORKSPACE_CHANGED] =
|
||||||
|
g_signal_new ("active-workspace-changed",
|
||||||
|
G_TYPE_FROM_CLASS (klass),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
0, NULL, NULL, NULL,
|
||||||
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
|
workspace_manager_signals[SHOWING_DESKTOP_CHANGED] =
|
||||||
|
g_signal_new ("showing-desktop-changed",
|
||||||
|
G_TYPE_FROM_CLASS (klass),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
0, NULL, NULL, NULL,
|
||||||
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
|
g_object_class_install_property (object_class,
|
||||||
|
PROP_N_WORKSPACES,
|
||||||
|
g_param_spec_int ("n-workspaces",
|
||||||
|
"N Workspaces",
|
||||||
|
"Number of workspaces",
|
||||||
|
1, G_MAXINT, 1,
|
||||||
|
G_PARAM_READABLE));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_workspace_manager_init (MetaWorkspaceManager *workspace_manager)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
reload_logical_monitors (MetaWorkspaceManager *workspace_manager)
|
||||||
|
{
|
||||||
|
GList *l;
|
||||||
|
|
||||||
|
for (l = workspace_manager->workspaces; l != NULL; l = l->next)
|
||||||
|
{
|
||||||
|
MetaWorkspace *space = l->data;
|
||||||
|
meta_workspace_invalidate_work_area (space);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MetaWorkspaceManager *
|
||||||
|
meta_workspace_manager_new (MetaDisplay *display)
|
||||||
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager;
|
||||||
|
MetaBackend *backend = meta_get_backend ();
|
||||||
|
MetaMonitorManager *monitor_manager
|
||||||
|
= meta_backend_get_monitor_manager (backend);
|
||||||
|
|
||||||
|
workspace_manager = g_object_new (META_TYPE_WORKSPACE_MANAGER, NULL);
|
||||||
|
|
||||||
|
workspace_manager->display = display;
|
||||||
|
workspace_manager->active_workspace = NULL;
|
||||||
|
workspace_manager->workspaces = NULL;
|
||||||
|
workspace_manager->rows_of_workspaces = 1;
|
||||||
|
workspace_manager->columns_of_workspaces = -1;
|
||||||
|
workspace_manager->vertical_workspaces = FALSE;
|
||||||
|
workspace_manager->starting_corner = META_DISPLAY_TOPLEFT;
|
||||||
|
|
||||||
|
/* This is the default layout extracted from default
|
||||||
|
* variable values in update_num_workspaces ()
|
||||||
|
* This can be overriden using _NET_DESKTOP_LAYOUT in
|
||||||
|
* meta_x11_display_new (), if it's specified */
|
||||||
|
meta_workspace_manager_update_workspace_layout (workspace_manager,
|
||||||
|
META_DISPLAY_TOPLEFT,
|
||||||
|
FALSE,
|
||||||
|
-1,
|
||||||
|
1);
|
||||||
|
|
||||||
|
/* There must be at least one workspace at all times,
|
||||||
|
* so create that required workspace.
|
||||||
|
*/
|
||||||
|
meta_workspace_new (workspace_manager);
|
||||||
|
|
||||||
|
meta_workspace_manager_init_workspaces (workspace_manager);
|
||||||
|
|
||||||
|
reload_logical_monitors (workspace_manager);
|
||||||
|
|
||||||
|
g_signal_connect_object (monitor_manager,
|
||||||
|
"monitors-changed",
|
||||||
|
G_CALLBACK (reload_logical_monitors),
|
||||||
|
workspace_manager,
|
||||||
|
G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
|
meta_prefs_add_listener (prefs_changed_callback, workspace_manager);
|
||||||
|
|
||||||
|
return workspace_manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_workspace_manager_init_workspaces (MetaWorkspaceManager *workspace_manager)
|
||||||
|
{
|
||||||
|
int num;
|
||||||
|
|
||||||
|
g_return_if_fail (META_IS_WORKSPACE_MANAGER (workspace_manager));
|
||||||
|
|
||||||
|
if (meta_prefs_get_dynamic_workspaces ())
|
||||||
|
/* This will be properly updated using _NET_NUMBER_OF_DESKTOPS
|
||||||
|
* (if set) in meta_x11_display_new () */
|
||||||
|
num = 1;
|
||||||
|
else
|
||||||
|
num = meta_prefs_get_num_workspaces ();
|
||||||
|
|
||||||
|
meta_workspace_manager_update_num_workspaces (workspace_manager, META_CURRENT_TIME, num);
|
||||||
|
|
||||||
|
meta_workspace_activate (workspace_manager->workspaces->data, META_CURRENT_TIME);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
meta_workspace_manager_get_n_workspaces (MetaWorkspaceManager *workspace_manager)
|
||||||
|
{
|
||||||
|
return g_list_length (workspace_manager->workspaces);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* meta_workspace_manager_get_workspace_by_index:
|
||||||
|
* @workspace_manager: a #MetaWorkspaceManager
|
||||||
|
* @index: index of one of the display's workspaces
|
||||||
|
*
|
||||||
|
* Gets the workspace object for one of a workspace manager's workspaces given the workspace
|
||||||
|
* index. It's valid to call this function with an out-of-range index and it
|
||||||
|
* will robustly return %NULL.
|
||||||
|
*
|
||||||
|
* Return value: (transfer none): the workspace object with specified index, or %NULL
|
||||||
|
* if the index is out of range.
|
||||||
|
*/
|
||||||
|
MetaWorkspace *
|
||||||
|
meta_workspace_manager_get_workspace_by_index (MetaWorkspaceManager *workspace_manager,
|
||||||
|
int idx)
|
||||||
|
{
|
||||||
|
return g_list_nth_data (workspace_manager->workspaces, idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_workspace_manager_remove_workspace (MetaWorkspaceManager *workspace_manager,
|
||||||
|
MetaWorkspace *workspace,
|
||||||
|
guint32 timestamp)
|
||||||
|
{
|
||||||
|
GList *l;
|
||||||
|
GList *next;
|
||||||
|
MetaWorkspace *neighbour = NULL;
|
||||||
|
int index;
|
||||||
|
gboolean active_index_changed;
|
||||||
|
int new_num;
|
||||||
|
|
||||||
|
l = g_list_find (workspace_manager->workspaces, workspace);
|
||||||
|
if (!l)
|
||||||
|
return;
|
||||||
|
|
||||||
|
next = l->next;
|
||||||
|
|
||||||
|
if (l->prev)
|
||||||
|
neighbour = l->prev->data;
|
||||||
|
else if (l->next)
|
||||||
|
neighbour = l->next->data;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Cannot remove the only workspace! */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
meta_workspace_relocate_windows (workspace, neighbour);
|
||||||
|
|
||||||
|
if (workspace == workspace_manager->active_workspace)
|
||||||
|
meta_workspace_activate (neighbour, timestamp);
|
||||||
|
|
||||||
|
/* To emit the signal after removing the workspace */
|
||||||
|
index = meta_workspace_index (workspace);
|
||||||
|
active_index_changed = index < meta_workspace_manager_get_active_workspace_index (workspace_manager);
|
||||||
|
|
||||||
|
/* This also removes the workspace from the displays list */
|
||||||
|
meta_workspace_remove (workspace);
|
||||||
|
|
||||||
|
new_num = g_list_length (workspace_manager->workspaces);
|
||||||
|
|
||||||
|
if (!meta_prefs_get_dynamic_workspaces ())
|
||||||
|
meta_prefs_set_num_workspaces (new_num);
|
||||||
|
|
||||||
|
/* If deleting a workspace before the current workspace, the active
|
||||||
|
* workspace index changes, so we need to update that hint */
|
||||||
|
if (active_index_changed)
|
||||||
|
g_signal_emit (workspace_manager, workspace_manager_signals[ACTIVE_WORKSPACE_CHANGED], 0, NULL);
|
||||||
|
|
||||||
|
for (l = next; l != NULL; l = l->next)
|
||||||
|
{
|
||||||
|
MetaWorkspace *w = l->data;
|
||||||
|
meta_workspace_index_changed (w);
|
||||||
|
}
|
||||||
|
|
||||||
|
meta_display_queue_workarea_recalc (workspace_manager->display);
|
||||||
|
|
||||||
|
g_signal_emit (workspace_manager, workspace_manager_signals[WORKSPACE_REMOVED], 0, index);
|
||||||
|
g_object_notify (G_OBJECT (workspace_manager), "n-workspaces");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* meta_workspace_manager_append_new_workspace:
|
||||||
|
* @workspace_manager: a #MetaWorkspaceManager
|
||||||
|
* @activate: %TRUE if the workspace should be switched to after creation
|
||||||
|
* @timestamp: if switching to a new workspace, timestamp to be used when
|
||||||
|
* focusing a window on the new workspace. (Doesn't hurt to pass a valid
|
||||||
|
* timestamp when available even if not switching workspaces.)
|
||||||
|
*
|
||||||
|
* Append a new workspace to the workspace manager and (optionally) switch to that
|
||||||
|
* display.
|
||||||
|
*
|
||||||
|
* Return value: (transfer none): the newly appended workspace.
|
||||||
|
*/
|
||||||
|
MetaWorkspace *
|
||||||
|
meta_workspace_manager_append_new_workspace (MetaWorkspaceManager *workspace_manager,
|
||||||
|
gboolean activate,
|
||||||
|
guint32 timestamp)
|
||||||
|
{
|
||||||
|
MetaWorkspace *w;
|
||||||
|
int new_num;
|
||||||
|
|
||||||
|
/* This also adds the workspace to the workspace manager list */
|
||||||
|
w = meta_workspace_new (workspace_manager);
|
||||||
|
|
||||||
|
if (!w)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (activate)
|
||||||
|
meta_workspace_activate (w, timestamp);
|
||||||
|
|
||||||
|
new_num = g_list_length (workspace_manager->workspaces);
|
||||||
|
|
||||||
|
if (!meta_prefs_get_dynamic_workspaces ())
|
||||||
|
meta_prefs_set_num_workspaces (new_num);
|
||||||
|
|
||||||
|
meta_display_queue_workarea_recalc (workspace_manager->display);
|
||||||
|
|
||||||
|
g_signal_emit (workspace_manager, workspace_manager_signals[WORKSPACE_ADDED],
|
||||||
|
0, meta_workspace_index (w));
|
||||||
|
g_object_notify (G_OBJECT (workspace_manager), "n-workspaces");
|
||||||
|
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_workspace_manager_update_num_workspaces (MetaWorkspaceManager *workspace_manager,
|
||||||
|
guint32 timestamp,
|
||||||
|
int new_num)
|
||||||
|
{
|
||||||
|
int old_num;
|
||||||
|
GList *l;
|
||||||
|
int i = 0;
|
||||||
|
GList *extras = NULL;
|
||||||
|
MetaWorkspace *last_remaining = NULL;
|
||||||
|
gboolean need_change_space = FALSE;
|
||||||
|
|
||||||
|
g_assert (new_num > 0);
|
||||||
|
|
||||||
|
if (g_list_length (workspace_manager->workspaces) == (guint) new_num)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (l = workspace_manager->workspaces; l != NULL; l = l->next)
|
||||||
|
{
|
||||||
|
MetaWorkspace *w = l->data;
|
||||||
|
|
||||||
|
if (i >= new_num)
|
||||||
|
extras = g_list_prepend (extras, w);
|
||||||
|
else
|
||||||
|
last_remaining = w;
|
||||||
|
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
old_num = i;
|
||||||
|
|
||||||
|
g_assert (last_remaining);
|
||||||
|
|
||||||
|
/* Get rid of the extra workspaces by moving all their windows
|
||||||
|
* to last_remaining, then activating last_remaining if
|
||||||
|
* one of the removed workspaces was active. This will be a bit
|
||||||
|
* wacky if the config tool for changing number of workspaces
|
||||||
|
* is on a removed workspace ;-)
|
||||||
|
*/
|
||||||
|
for (l = extras; l != NULL; l = l->next)
|
||||||
|
{
|
||||||
|
MetaWorkspace *w = l->data;
|
||||||
|
|
||||||
|
meta_workspace_relocate_windows (w, last_remaining);
|
||||||
|
|
||||||
|
if (w == workspace_manager->active_workspace)
|
||||||
|
need_change_space = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (need_change_space)
|
||||||
|
meta_workspace_activate (last_remaining, timestamp);
|
||||||
|
|
||||||
|
/* Should now be safe to free the workspaces */
|
||||||
|
for (l = extras; l != NULL; l = l->next)
|
||||||
|
{
|
||||||
|
MetaWorkspace *w = l->data;
|
||||||
|
|
||||||
|
meta_workspace_remove (w);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_list_free (extras);
|
||||||
|
|
||||||
|
for (i = old_num; i < new_num; i++)
|
||||||
|
meta_workspace_new (workspace_manager);
|
||||||
|
|
||||||
|
meta_display_queue_workarea_recalc (workspace_manager->display);
|
||||||
|
|
||||||
|
for (i = old_num; i < new_num; i++)
|
||||||
|
g_signal_emit (workspace_manager, workspace_manager_signals[WORKSPACE_ADDED], 0, i);
|
||||||
|
|
||||||
|
g_object_notify (G_OBJECT (workspace_manager), "n-workspaces");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_workspace_manager_update_workspace_layout (MetaWorkspaceManager *workspace_manager,
|
||||||
|
MetaDisplayCorner starting_corner,
|
||||||
|
gboolean vertical_layout,
|
||||||
|
int n_rows,
|
||||||
|
int n_columns)
|
||||||
|
{
|
||||||
|
g_return_if_fail (META_IS_WORKSPACE_MANAGER (workspace_manager));
|
||||||
|
g_return_if_fail (n_rows > 0 || n_columns > 0);
|
||||||
|
g_return_if_fail (n_rows != 0 && n_columns != 0);
|
||||||
|
|
||||||
|
if (workspace_manager->workspace_layout_overridden)
|
||||||
|
return;
|
||||||
|
|
||||||
|
workspace_manager->vertical_workspaces = vertical_layout != FALSE;
|
||||||
|
workspace_manager->starting_corner = starting_corner;
|
||||||
|
workspace_manager->rows_of_workspaces = n_rows;
|
||||||
|
workspace_manager->columns_of_workspaces = n_columns;
|
||||||
|
|
||||||
|
meta_verbose ("Workspace layout rows = %d cols = %d orientation = %d starting corner = %u\n",
|
||||||
|
workspace_manager->rows_of_workspaces,
|
||||||
|
workspace_manager->columns_of_workspaces,
|
||||||
|
workspace_manager->vertical_workspaces,
|
||||||
|
workspace_manager->starting_corner);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* meta_workspace_manager_override_workspace_layout:
|
||||||
|
* @workspace_manager: a #MetaWorkspaceManager
|
||||||
|
* @starting_corner: the corner at which the first workspace is found
|
||||||
|
* @vertical_layout: if %TRUE the workspaces are laid out in columns rather than rows
|
||||||
|
* @n_rows: number of rows of workspaces, or -1 to determine the number of rows from
|
||||||
|
* @n_columns and the total number of workspaces
|
||||||
|
* @n_columns: number of columns of workspaces, or -1 to determine the number of columns from
|
||||||
|
* @n_rows and the total number of workspaces
|
||||||
|
*
|
||||||
|
* Explicitly set the layout of workspaces. Once this has been called, the contents of the
|
||||||
|
* _NET_DESKTOP_LAYOUT property on the root window are completely ignored.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
meta_workspace_manager_override_workspace_layout (MetaWorkspaceManager *workspace_manager,
|
||||||
|
MetaDisplayCorner starting_corner,
|
||||||
|
gboolean vertical_layout,
|
||||||
|
int n_rows,
|
||||||
|
int n_columns)
|
||||||
|
{
|
||||||
|
meta_workspace_manager_update_workspace_layout (workspace_manager,
|
||||||
|
starting_corner,
|
||||||
|
vertical_layout,
|
||||||
|
n_rows,
|
||||||
|
n_columns);
|
||||||
|
|
||||||
|
workspace_manager->workspace_layout_overridden = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_VERBOSE_MODE
|
||||||
|
static const char *
|
||||||
|
meta_workspace_manager_corner_to_string (MetaDisplayCorner corner)
|
||||||
|
{
|
||||||
|
switch (corner)
|
||||||
|
{
|
||||||
|
case META_DISPLAY_TOPLEFT:
|
||||||
|
return "TopLeft";
|
||||||
|
case META_DISPLAY_TOPRIGHT:
|
||||||
|
return "TopRight";
|
||||||
|
case META_DISPLAY_BOTTOMLEFT:
|
||||||
|
return "BottomLeft";
|
||||||
|
case META_DISPLAY_BOTTOMRIGHT:
|
||||||
|
return "BottomRight";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
#endif /* WITH_VERBOSE_MODE */
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_manager,
|
||||||
|
int num_workspaces,
|
||||||
|
int current_space,
|
||||||
|
MetaWorkspaceLayout *layout)
|
||||||
|
{
|
||||||
|
int rows, cols;
|
||||||
|
int grid_area;
|
||||||
|
int *grid;
|
||||||
|
int i, r, c;
|
||||||
|
int current_row, current_col;
|
||||||
|
|
||||||
|
rows = workspace_manager->rows_of_workspaces;
|
||||||
|
cols = workspace_manager->columns_of_workspaces;
|
||||||
|
if (rows <= 0 && cols <= 0)
|
||||||
|
cols = num_workspaces;
|
||||||
|
|
||||||
|
if (rows <= 0)
|
||||||
|
rows = num_workspaces / cols + ((num_workspaces % cols) > 0 ? 1 : 0);
|
||||||
|
if (cols <= 0)
|
||||||
|
cols = num_workspaces / rows + ((num_workspaces % rows) > 0 ? 1 : 0);
|
||||||
|
|
||||||
|
/* paranoia */
|
||||||
|
if (rows < 1)
|
||||||
|
rows = 1;
|
||||||
|
if (cols < 1)
|
||||||
|
cols = 1;
|
||||||
|
|
||||||
|
g_assert (rows != 0 && cols != 0);
|
||||||
|
|
||||||
|
grid_area = rows * cols;
|
||||||
|
|
||||||
|
meta_verbose ("Getting layout rows = %d cols = %d current = %d "
|
||||||
|
"num_spaces = %d vertical = %s corner = %s\n",
|
||||||
|
rows, cols, current_space, num_workspaces,
|
||||||
|
workspace_manager->vertical_workspaces ? "(true)" : "(false)",
|
||||||
|
meta_workspace_manager_corner_to_string (workspace_manager->starting_corner));
|
||||||
|
|
||||||
|
/* ok, we want to setup the distances in the workspace array to go
|
||||||
|
* in each direction. Remember, there are many ways that a workspace
|
||||||
|
* array can be setup.
|
||||||
|
* see http://www.freedesktop.org/standards/wm-spec/1.2/html/x109.html
|
||||||
|
* and look at the _NET_DESKTOP_LAYOUT section for details.
|
||||||
|
* For instance:
|
||||||
|
*/
|
||||||
|
/* starting_corner = META_DISPLAY_TOPLEFT
|
||||||
|
* vertical_workspaces = 0 vertical_workspaces=1
|
||||||
|
* 1234 1357
|
||||||
|
* 5678 2468
|
||||||
|
*
|
||||||
|
* starting_corner = META_DISPLAY_TOPRIGHT
|
||||||
|
* vertical_workspaces = 0 vertical_workspaces=1
|
||||||
|
* 4321 7531
|
||||||
|
* 8765 8642
|
||||||
|
*
|
||||||
|
* starting_corner = META_DISPLAY_BOTTOMLEFT
|
||||||
|
* vertical_workspaces = 0 vertical_workspaces=1
|
||||||
|
* 5678 2468
|
||||||
|
* 1234 1357
|
||||||
|
*
|
||||||
|
* starting_corner = META_DISPLAY_BOTTOMRIGHT
|
||||||
|
* vertical_workspaces = 0 vertical_workspaces=1
|
||||||
|
* 8765 8642
|
||||||
|
* 4321 7531
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/* keep in mind that we could have a ragged layout, e.g. the "8"
|
||||||
|
* in the above grids could be missing
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
grid = g_new (int, grid_area);
|
||||||
|
|
||||||
|
current_row = -1;
|
||||||
|
current_col = -1;
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
switch (workspace_manager->starting_corner)
|
||||||
|
{
|
||||||
|
case META_DISPLAY_TOPLEFT:
|
||||||
|
if (workspace_manager->vertical_workspaces)
|
||||||
|
{
|
||||||
|
c = 0;
|
||||||
|
while (c < cols)
|
||||||
|
{
|
||||||
|
r = 0;
|
||||||
|
while (r < rows)
|
||||||
|
{
|
||||||
|
grid[r*cols+c] = i;
|
||||||
|
++i;
|
||||||
|
++r;
|
||||||
|
}
|
||||||
|
++c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
r = 0;
|
||||||
|
while (r < rows)
|
||||||
|
{
|
||||||
|
c = 0;
|
||||||
|
while (c < cols)
|
||||||
|
{
|
||||||
|
grid[r*cols+c] = i;
|
||||||
|
++i;
|
||||||
|
++c;
|
||||||
|
}
|
||||||
|
++r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case META_DISPLAY_TOPRIGHT:
|
||||||
|
if (workspace_manager->vertical_workspaces)
|
||||||
|
{
|
||||||
|
c = cols - 1;
|
||||||
|
while (c >= 0)
|
||||||
|
{
|
||||||
|
r = 0;
|
||||||
|
while (r < rows)
|
||||||
|
{
|
||||||
|
grid[r*cols+c] = i;
|
||||||
|
++i;
|
||||||
|
++r;
|
||||||
|
}
|
||||||
|
--c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
r = 0;
|
||||||
|
while (r < rows)
|
||||||
|
{
|
||||||
|
c = cols - 1;
|
||||||
|
while (c >= 0)
|
||||||
|
{
|
||||||
|
grid[r*cols+c] = i;
|
||||||
|
++i;
|
||||||
|
--c;
|
||||||
|
}
|
||||||
|
++r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case META_DISPLAY_BOTTOMLEFT:
|
||||||
|
if (workspace_manager->vertical_workspaces)
|
||||||
|
{
|
||||||
|
c = 0;
|
||||||
|
while (c < cols)
|
||||||
|
{
|
||||||
|
r = rows - 1;
|
||||||
|
while (r >= 0)
|
||||||
|
{
|
||||||
|
grid[r*cols+c] = i;
|
||||||
|
++i;
|
||||||
|
--r;
|
||||||
|
}
|
||||||
|
++c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
r = rows - 1;
|
||||||
|
while (r >= 0)
|
||||||
|
{
|
||||||
|
c = 0;
|
||||||
|
while (c < cols)
|
||||||
|
{
|
||||||
|
grid[r*cols+c] = i;
|
||||||
|
++i;
|
||||||
|
++c;
|
||||||
|
}
|
||||||
|
--r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case META_DISPLAY_BOTTOMRIGHT:
|
||||||
|
if (workspace_manager->vertical_workspaces)
|
||||||
|
{
|
||||||
|
c = cols - 1;
|
||||||
|
while (c >= 0)
|
||||||
|
{
|
||||||
|
r = rows - 1;
|
||||||
|
while (r >= 0)
|
||||||
|
{
|
||||||
|
grid[r*cols+c] = i;
|
||||||
|
++i;
|
||||||
|
--r;
|
||||||
|
}
|
||||||
|
--c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
r = rows - 1;
|
||||||
|
while (r >= 0)
|
||||||
|
{
|
||||||
|
c = cols - 1;
|
||||||
|
while (c >= 0)
|
||||||
|
{
|
||||||
|
grid[r*cols+c] = i;
|
||||||
|
++i;
|
||||||
|
--c;
|
||||||
|
}
|
||||||
|
--r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i != grid_area)
|
||||||
|
meta_bug ("did not fill in the whole workspace grid in %s (%d filled)\n",
|
||||||
|
G_STRFUNC, i);
|
||||||
|
|
||||||
|
current_row = 0;
|
||||||
|
current_col = 0;
|
||||||
|
r = 0;
|
||||||
|
while (r < rows)
|
||||||
|
{
|
||||||
|
c = 0;
|
||||||
|
while (c < cols)
|
||||||
|
{
|
||||||
|
if (grid[r*cols+c] == current_space)
|
||||||
|
{
|
||||||
|
current_row = r;
|
||||||
|
current_col = c;
|
||||||
|
}
|
||||||
|
else if (grid[r*cols+c] >= num_workspaces)
|
||||||
|
{
|
||||||
|
/* flag nonexistent spaces with -1 */
|
||||||
|
grid[r*cols+c] = -1;
|
||||||
|
}
|
||||||
|
++c;
|
||||||
|
}
|
||||||
|
++r;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout->rows = rows;
|
||||||
|
layout->cols = cols;
|
||||||
|
layout->grid = grid;
|
||||||
|
layout->grid_area = grid_area;
|
||||||
|
layout->current_row = current_row;
|
||||||
|
layout->current_col = current_col;
|
||||||
|
|
||||||
|
#ifdef WITH_VERBOSE_MODE
|
||||||
|
if (meta_is_verbose ())
|
||||||
|
{
|
||||||
|
r = 0;
|
||||||
|
while (r < layout->rows)
|
||||||
|
{
|
||||||
|
meta_verbose (" ");
|
||||||
|
meta_push_no_msg_prefix ();
|
||||||
|
c = 0;
|
||||||
|
while (c < layout->cols)
|
||||||
|
{
|
||||||
|
if (r == layout->current_row &&
|
||||||
|
c == layout->current_col)
|
||||||
|
meta_verbose ("*%2d ", layout->grid[r*layout->cols+c]);
|
||||||
|
else
|
||||||
|
meta_verbose ("%3d ", layout->grid[r*layout->cols+c]);
|
||||||
|
++c;
|
||||||
|
}
|
||||||
|
meta_verbose ("\n");
|
||||||
|
meta_pop_no_msg_prefix ();
|
||||||
|
++r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* WITH_VERBOSE_MODE */
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_workspace_manager_free_workspace_layout (MetaWorkspaceLayout *layout)
|
||||||
|
{
|
||||||
|
g_free (layout->grid);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
queue_windows_showing (MetaWorkspaceManager *workspace_manager)
|
||||||
|
{
|
||||||
|
GSList *windows, *l;
|
||||||
|
|
||||||
|
/* Must operate on all windows on display instead of just on the
|
||||||
|
* active_workspace's window list, because the active_workspace's
|
||||||
|
* window list may not contain the on_all_workspace windows.
|
||||||
|
*/
|
||||||
|
windows = meta_display_list_windows (workspace_manager->display, META_LIST_DEFAULT);
|
||||||
|
|
||||||
|
for (l = windows; l != NULL; l = l->next)
|
||||||
|
{
|
||||||
|
MetaWindow *w = l->data;
|
||||||
|
meta_window_queue (w, META_QUEUE_CALC_SHOWING);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_slist_free (windows);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_workspace_manager_minimize_all_on_active_workspace_except (MetaWorkspaceManager *workspace_manager,
|
||||||
|
MetaWindow *keep)
|
||||||
|
{
|
||||||
|
GList *l;
|
||||||
|
|
||||||
|
for (l = workspace_manager->active_workspace->windows; l != NULL; l = l->next)
|
||||||
|
{
|
||||||
|
MetaWindow *w = l->data;
|
||||||
|
|
||||||
|
if (w->has_minimize_func && w != keep)
|
||||||
|
meta_window_minimize (w);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_workspace_manager_show_desktop (MetaWorkspaceManager *workspace_manager,
|
||||||
|
guint32 timestamp)
|
||||||
|
{
|
||||||
|
GList *l;
|
||||||
|
|
||||||
|
if (workspace_manager->active_workspace->showing_desktop)
|
||||||
|
return;
|
||||||
|
|
||||||
|
workspace_manager->active_workspace->showing_desktop = TRUE;
|
||||||
|
|
||||||
|
queue_windows_showing (workspace_manager);
|
||||||
|
|
||||||
|
/* Focus the most recently used META_WINDOW_DESKTOP window, if there is one;
|
||||||
|
* see bug 159257.
|
||||||
|
*/
|
||||||
|
for (l = workspace_manager->active_workspace->mru_list; l != NULL; l = l->next)
|
||||||
|
{
|
||||||
|
MetaWindow *w = l->data;
|
||||||
|
|
||||||
|
if (w->type == META_WINDOW_DESKTOP)
|
||||||
|
{
|
||||||
|
meta_window_focus (w, timestamp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g_signal_emit (workspace_manager, workspace_manager_signals[SHOWING_DESKTOP_CHANGED], 0, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_workspace_manager_unshow_desktop (MetaWorkspaceManager *workspace_manager)
|
||||||
|
{
|
||||||
|
if (!workspace_manager->active_workspace->showing_desktop)
|
||||||
|
return;
|
||||||
|
|
||||||
|
workspace_manager->active_workspace->showing_desktop = FALSE;
|
||||||
|
|
||||||
|
queue_windows_showing (workspace_manager);
|
||||||
|
|
||||||
|
g_signal_emit (workspace_manager, workspace_manager_signals[SHOWING_DESKTOP_CHANGED], 0, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* meta_workspace_manager_get_workspaces: (skip)
|
||||||
|
* @workspace_manager: a #MetaWorkspaceManager
|
||||||
|
*
|
||||||
|
* Returns: (transfer none) (element-type Meta.Workspace): The workspaces for @display
|
||||||
|
*/
|
||||||
|
GList *
|
||||||
|
meta_workspace_manager_get_workspaces (MetaWorkspaceManager *workspace_manager)
|
||||||
|
{
|
||||||
|
return workspace_manager->workspaces;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
meta_workspace_manager_get_active_workspace_index (MetaWorkspaceManager *workspace_manager)
|
||||||
|
{
|
||||||
|
MetaWorkspace *active = workspace_manager->active_workspace;
|
||||||
|
|
||||||
|
if (!active)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return meta_workspace_index (active);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* meta_workspace_manager_get_active_workspace:
|
||||||
|
* @workspace_manager: A #MetaWorkspaceManager
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): The current workspace
|
||||||
|
*/
|
||||||
|
MetaWorkspace *
|
||||||
|
meta_workspace_manager_get_active_workspace (MetaWorkspaceManager *workspace_manager)
|
||||||
|
{
|
||||||
|
return workspace_manager->active_workspace;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_workspace_manager_workspace_switched (MetaWorkspaceManager *workspace_manager,
|
||||||
|
int from,
|
||||||
|
int to,
|
||||||
|
MetaMotionDirection direction)
|
||||||
|
{
|
||||||
|
g_signal_emit (workspace_manager, workspace_manager_signals[WORKSPACE_SWITCHED], 0,
|
||||||
|
from, to, direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
prefs_changed_callback (MetaPreference pref,
|
||||||
|
void *data)
|
||||||
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = data;
|
||||||
|
|
||||||
|
if ((pref == META_PREF_NUM_WORKSPACES ||
|
||||||
|
pref == META_PREF_DYNAMIC_WORKSPACES) &&
|
||||||
|
!meta_prefs_get_dynamic_workspaces ())
|
||||||
|
{
|
||||||
|
/* GSettings doesn't provide timestamps, but luckily update_num_workspaces
|
||||||
|
* often doesn't need it...
|
||||||
|
*/
|
||||||
|
guint32 timestamp =
|
||||||
|
meta_display_get_current_time_roundtrip (workspace_manager->display);
|
||||||
|
int new_num = meta_prefs_get_num_workspaces ();
|
||||||
|
meta_workspace_manager_update_num_workspaces (workspace_manager, timestamp, new_num);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "keybindings-private.h"
|
#include "keybindings-private.h"
|
||||||
#include "meta-accel-parse.h"
|
#include "meta-accel-parse.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
/* If you add a key, it needs updating in init() and in the gsettings
|
/* If you add a key, it needs updating in init() and in the gsettings
|
||||||
* notify listener and of course in the .schemas file.
|
* notify listener and of course in the .schemas file.
|
||||||
@@ -137,13 +138,6 @@ static void bindings_changed (GSettings *settings,
|
|||||||
gchar *key,
|
gchar *key,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
static void shell_shows_app_menu_changed (GtkSettings *settings,
|
|
||||||
GParamSpec *pspec,
|
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
static void update_cursor_size_from_gtk (GtkSettings *settings,
|
|
||||||
GParamSpec *pspec,
|
|
||||||
gpointer data);
|
|
||||||
static void update_cursor_size (void);
|
static void update_cursor_size (void);
|
||||||
|
|
||||||
static void queue_changed (MetaPreference pref);
|
static void queue_changed (MetaPreference pref);
|
||||||
@@ -160,7 +154,6 @@ static void do_override (char *key, char *schema);
|
|||||||
|
|
||||||
static void init_bindings (void);
|
static void init_bindings (void);
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
MetaPrefsChangedFunc func;
|
MetaPrefsChangedFunc func;
|
||||||
@@ -976,14 +969,6 @@ meta_prefs_init (void)
|
|||||||
G_CALLBACK (wayland_settings_changed), NULL);
|
G_CALLBACK (wayland_settings_changed), NULL);
|
||||||
g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_INTERFACE), settings);
|
g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_INTERFACE), settings);
|
||||||
|
|
||||||
g_signal_connect (gtk_settings_get_default (),
|
|
||||||
"notify::gtk-shell-shows-app-menu",
|
|
||||||
G_CALLBACK (shell_shows_app_menu_changed), NULL);
|
|
||||||
|
|
||||||
if (!meta_is_wayland_compositor ())
|
|
||||||
g_signal_connect (gtk_settings_get_default (), "notify::gtk-cursor-theme-size",
|
|
||||||
G_CALLBACK (update_cursor_size_from_gtk), NULL);
|
|
||||||
|
|
||||||
settings = g_settings_new (SCHEMA_INPUT_SOURCES);
|
settings = g_settings_new (SCHEMA_INPUT_SOURCES);
|
||||||
g_signal_connect (settings, "changed::" KEY_XKB_OPTIONS,
|
g_signal_connect (settings, "changed::" KEY_XKB_OPTIONS,
|
||||||
G_CALLBACK (settings_changed), NULL);
|
G_CALLBACK (settings_changed), NULL);
|
||||||
@@ -1005,7 +990,6 @@ meta_prefs_init (void)
|
|||||||
handle_preference_init_int ();
|
handle_preference_init_int ();
|
||||||
|
|
||||||
update_cursor_size ();
|
update_cursor_size ();
|
||||||
shell_shows_app_menu_changed (gtk_settings_get_default (), NULL, NULL);
|
|
||||||
|
|
||||||
init_bindings ();
|
init_bindings ();
|
||||||
}
|
}
|
||||||
@@ -1220,27 +1204,6 @@ bindings_changed (GSettings *settings,
|
|||||||
g_strfreev (strokes);
|
g_strfreev (strokes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
shell_shows_app_menu_changed (GtkSettings *settings,
|
|
||||||
GParamSpec *pspec,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
int shell_shows_app_menu = 1;
|
|
||||||
gboolean changed = FALSE;
|
|
||||||
|
|
||||||
g_object_get (settings,
|
|
||||||
"gtk-shell-shows-app-menu", &shell_shows_app_menu,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
|
|
||||||
changed = (show_fallback_app_menu == !!shell_shows_app_menu);
|
|
||||||
|
|
||||||
show_fallback_app_menu = !shell_shows_app_menu;
|
|
||||||
|
|
||||||
if (changed)
|
|
||||||
queue_changed (META_PREF_BUTTON_LAYOUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_cursor_size (void)
|
update_cursor_size (void)
|
||||||
{
|
{
|
||||||
@@ -1255,13 +1218,9 @@ update_cursor_size (void)
|
|||||||
cursor_size =
|
cursor_size =
|
||||||
g_settings_get_int (SETTINGS (SCHEMA_INTERFACE), "cursor-size");
|
g_settings_get_int (SETTINGS (SCHEMA_INTERFACE), "cursor-size");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
update_cursor_size_from_gtk (gtk_settings_get_default (), NULL, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
update_cursor_size_from_gtk (GtkSettings *settings,
|
update_cursor_size_from_gtk (GtkSettings *settings,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
@@ -1345,6 +1304,19 @@ meta_prefs_get_show_fallback_app_menu (void)
|
|||||||
return show_fallback_app_menu;
|
return show_fallback_app_menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_prefs_set_show_fallback_app_menu (gboolean whether)
|
||||||
|
{
|
||||||
|
gboolean changed = FALSE;
|
||||||
|
|
||||||
|
changed = (show_fallback_app_menu == !whether);
|
||||||
|
|
||||||
|
show_fallback_app_menu = whether;
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
queue_changed (META_PREF_BUTTON_LAYOUT);
|
||||||
|
}
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
meta_prefs_get_cursor_theme (void)
|
meta_prefs_get_cursor_theme (void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,21 +43,16 @@
|
|||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util-private.h"
|
#include "util-private.h"
|
||||||
#include "display-private.h"
|
#include "display-private.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
static gboolean restart_helper_started = FALSE;
|
static gboolean restart_helper_started = FALSE;
|
||||||
static gboolean restart_message_shown = FALSE;
|
static gboolean restart_message_shown = FALSE;
|
||||||
static gboolean is_restart = FALSE;
|
static gboolean is_restart = FALSE;
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_restart_init (void)
|
meta_set_is_restart (gboolean whether)
|
||||||
{
|
{
|
||||||
Display *xdisplay = meta_ui_get_display ();
|
is_restart = whether;
|
||||||
Atom atom_restart_helper = XInternAtom (xdisplay, "_MUTTER_RESTART_HELPER", False);
|
|
||||||
Window restart_helper_window = None;
|
|
||||||
|
|
||||||
restart_helper_window = XGetSelectionOwner (xdisplay, atom_restart_helper);
|
|
||||||
if (restart_helper_window)
|
|
||||||
is_restart = TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -186,17 +181,6 @@ meta_restart (const char *message)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
meta_restart_finish (void)
|
|
||||||
{
|
|
||||||
if (is_restart)
|
|
||||||
{
|
|
||||||
Display *xdisplay = meta_display_get_xdisplay (meta_get_display ());
|
|
||||||
Atom atom_restart_helper = XInternAtom (xdisplay, "_MUTTER_RESTART_HELPER", False);
|
|
||||||
XSetSelectionOwner (xdisplay, atom_restart_helper, None, CurrentTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_is_restart:
|
* meta_is_restart:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,194 +0,0 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file screen-private.h Screens which Mutter manages
|
|
||||||
*
|
|
||||||
* Managing X screens.
|
|
||||||
* This file contains methods on this class which are available to
|
|
||||||
* routines in core but not outside it. (See screen.h for the routines
|
|
||||||
* which the rest of the world is allowed to use.)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2001 Havoc Pennington
|
|
||||||
* Copyright (C) 2003 Rob Adams
|
|
||||||
* Copyright (C) 2004-2006 Elijah Newren
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef META_SCREEN_PRIVATE_H
|
|
||||||
#define META_SCREEN_PRIVATE_H
|
|
||||||
|
|
||||||
#include "display-private.h"
|
|
||||||
#include <meta/screen.h>
|
|
||||||
#include <X11/Xutil.h>
|
|
||||||
#include "stack-tracker.h"
|
|
||||||
#include "ui.h"
|
|
||||||
#include "meta-monitor-manager-private.h"
|
|
||||||
|
|
||||||
typedef void (* MetaScreenWindowFunc) (MetaWindow *window,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
#define META_WIREFRAME_XOR_LINE_WIDTH 2
|
|
||||||
|
|
||||||
struct _MetaScreen
|
|
||||||
{
|
|
||||||
GObject parent_instance;
|
|
||||||
|
|
||||||
MetaDisplay *display;
|
|
||||||
char *screen_name;
|
|
||||||
Window xroot;
|
|
||||||
int default_depth;
|
|
||||||
Visual *default_xvisual;
|
|
||||||
MetaRectangle rect; /* Size of screen; rect.x & rect.y are always 0 */
|
|
||||||
MetaUI *ui;
|
|
||||||
|
|
||||||
guint tile_preview_timeout_id;
|
|
||||||
|
|
||||||
MetaWorkspace *active_workspace;
|
|
||||||
|
|
||||||
/* This window holds the focus when we don't want to focus
|
|
||||||
* any actual clients
|
|
||||||
*/
|
|
||||||
Window no_focus_window;
|
|
||||||
|
|
||||||
GList *workspaces;
|
|
||||||
|
|
||||||
MetaStack *stack;
|
|
||||||
MetaStackTracker *stack_tracker;
|
|
||||||
|
|
||||||
MetaCursor current_cursor;
|
|
||||||
|
|
||||||
Window wm_sn_selection_window;
|
|
||||||
Atom wm_sn_atom;
|
|
||||||
guint32 wm_sn_timestamp;
|
|
||||||
|
|
||||||
gboolean has_xinerama_indices;
|
|
||||||
|
|
||||||
GSList *startup_sequences;
|
|
||||||
|
|
||||||
Window wm_cm_selection_window;
|
|
||||||
guint work_area_later;
|
|
||||||
guint check_fullscreen_later;
|
|
||||||
|
|
||||||
int rows_of_workspaces;
|
|
||||||
int columns_of_workspaces;
|
|
||||||
MetaScreenCorner starting_corner;
|
|
||||||
guint vertical_workspaces : 1;
|
|
||||||
guint workspace_layout_overridden : 1;
|
|
||||||
|
|
||||||
guint keys_grabbed : 1;
|
|
||||||
|
|
||||||
int closing;
|
|
||||||
|
|
||||||
/* Instead of unmapping withdrawn windows we can leave them mapped
|
|
||||||
* and restack them below a guard window. When using a compositor
|
|
||||||
* this allows us to provide live previews of unmapped windows */
|
|
||||||
Window guard_window;
|
|
||||||
|
|
||||||
Window composite_overlay_window;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _MetaScreenClass
|
|
||||||
{
|
|
||||||
GObjectClass parent_class;
|
|
||||||
|
|
||||||
void (*restacked) (MetaScreen *);
|
|
||||||
void (*workareas_changed) (MetaScreen *);
|
|
||||||
void (*monitors_changed) (MetaScreen *);
|
|
||||||
};
|
|
||||||
|
|
||||||
MetaScreen* meta_screen_new (MetaDisplay *display,
|
|
||||||
guint32 timestamp);
|
|
||||||
void meta_screen_free (MetaScreen *screen,
|
|
||||||
guint32 timestamp);
|
|
||||||
void meta_screen_init_workspaces (MetaScreen *screen);
|
|
||||||
void meta_screen_manage_all_windows (MetaScreen *screen);
|
|
||||||
void meta_screen_foreach_window (MetaScreen *screen,
|
|
||||||
MetaListWindowsFlags flags,
|
|
||||||
MetaScreenWindowFunc func,
|
|
||||||
gpointer data);
|
|
||||||
|
|
||||||
void meta_screen_update_cursor (MetaScreen *screen);
|
|
||||||
|
|
||||||
void meta_screen_update_tile_preview (MetaScreen *screen,
|
|
||||||
gboolean delay);
|
|
||||||
void meta_screen_hide_tile_preview (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);
|
|
||||||
void meta_screen_queue_workarea_recalc (MetaScreen *screen);
|
|
||||||
void meta_screen_queue_check_fullscreen (MetaScreen *screen);
|
|
||||||
|
|
||||||
|
|
||||||
Window meta_create_offscreen_window (Display *xdisplay,
|
|
||||||
Window parent,
|
|
||||||
long valuemask);
|
|
||||||
|
|
||||||
typedef struct MetaWorkspaceLayout MetaWorkspaceLayout;
|
|
||||||
|
|
||||||
struct MetaWorkspaceLayout
|
|
||||||
{
|
|
||||||
int rows;
|
|
||||||
int cols;
|
|
||||||
int *grid;
|
|
||||||
int grid_area;
|
|
||||||
int current_row;
|
|
||||||
int current_col;
|
|
||||||
};
|
|
||||||
|
|
||||||
void meta_screen_calc_workspace_layout (MetaScreen *screen,
|
|
||||||
int num_workspaces,
|
|
||||||
int current_space,
|
|
||||||
MetaWorkspaceLayout *layout);
|
|
||||||
void meta_screen_free_workspace_layout (MetaWorkspaceLayout *layout);
|
|
||||||
|
|
||||||
void meta_screen_minimize_all_on_active_workspace_except (MetaScreen *screen,
|
|
||||||
MetaWindow *keep);
|
|
||||||
|
|
||||||
/* Show/hide the desktop (temporarily hide all windows) */
|
|
||||||
void meta_screen_show_desktop (MetaScreen *screen,
|
|
||||||
guint32 timestamp);
|
|
||||||
void meta_screen_unshow_desktop (MetaScreen *screen);
|
|
||||||
|
|
||||||
/* Update whether the destkop is being shown for the current active_workspace */
|
|
||||||
void meta_screen_update_showing_desktop_hint (MetaScreen *screen);
|
|
||||||
|
|
||||||
gboolean meta_screen_apply_startup_properties (MetaScreen *screen,
|
|
||||||
MetaWindow *window);
|
|
||||||
void meta_screen_restacked (MetaScreen *screen);
|
|
||||||
|
|
||||||
void meta_screen_workspace_switched (MetaScreen *screen,
|
|
||||||
int from,
|
|
||||||
int to,
|
|
||||||
MetaMotionDirection direction);
|
|
||||||
|
|
||||||
void meta_screen_set_active_workspace_hint (MetaScreen *screen);
|
|
||||||
|
|
||||||
void meta_screen_create_guard_window (MetaScreen *screen);
|
|
||||||
|
|
||||||
gboolean meta_screen_handle_xevent (MetaScreen *screen,
|
|
||||||
XEvent *xevent);
|
|
||||||
|
|
||||||
MetaLogicalMonitor * meta_screen_xinerama_index_to_logical_monitor (MetaScreen *screen,
|
|
||||||
int index);
|
|
||||||
|
|
||||||
int meta_screen_logical_monitor_to_xinerama_index (MetaScreen *screen,
|
|
||||||
MetaLogicalMonitor *logical_monitor);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
2862
src/core/screen.c
2862
src/core/screen.c
File diff suppressed because it is too large
Load Diff
@@ -37,13 +37,15 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include "screen-private.h"
|
#include "display-private.h"
|
||||||
#include "stack-tracker.h"
|
#include "stack-tracker.h"
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include <meta/util.h>
|
#include <meta/util.h>
|
||||||
|
|
||||||
#include <meta/compositor.h>
|
#include <meta/compositor.h>
|
||||||
|
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
/* The complexity here comes from resolving two competing factors:
|
/* The complexity here comes from resolving two competing factors:
|
||||||
*
|
*
|
||||||
* - We need to have a view of the stacking order that takes into
|
* - We need to have a view of the stacking order that takes into
|
||||||
@@ -140,7 +142,7 @@ union _MetaStackOp
|
|||||||
|
|
||||||
struct _MetaStackTracker
|
struct _MetaStackTracker
|
||||||
{
|
{
|
||||||
MetaScreen *screen;
|
MetaDisplay *display;
|
||||||
|
|
||||||
/* This is the serial of the last request we made that was reflected
|
/* This is the serial of the last request we made that was reflected
|
||||||
* in xserver_stack
|
* in xserver_stack
|
||||||
@@ -175,7 +177,7 @@ static inline const char *
|
|||||||
get_window_desc (MetaStackTracker *tracker,
|
get_window_desc (MetaStackTracker *tracker,
|
||||||
guint64 window)
|
guint64 window)
|
||||||
{
|
{
|
||||||
return meta_display_describe_stack_id (tracker->screen->display, window);
|
return meta_display_describe_stack_id (tracker->display, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -474,41 +476,47 @@ copy_stack (GArray *stack)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
query_xserver_stack (MetaStackTracker *tracker)
|
query_xserver_stack (MetaDisplay *display,
|
||||||
|
MetaStackTracker *tracker)
|
||||||
{
|
{
|
||||||
MetaScreen *screen = tracker->screen;
|
MetaX11Display *x11_display = display->x11_display;
|
||||||
Window ignored1, ignored2;
|
Window ignored1, ignored2;
|
||||||
Window *children;
|
Window *children;
|
||||||
guint n_children;
|
guint n_children;
|
||||||
guint i;
|
guint i, old_len;
|
||||||
|
|
||||||
tracker->xserver_serial = XNextRequest (screen->display->xdisplay);
|
tracker->xserver_serial = XNextRequest (x11_display->xdisplay);
|
||||||
|
|
||||||
XQueryTree (screen->display->xdisplay,
|
XQueryTree (x11_display->xdisplay,
|
||||||
screen->xroot,
|
x11_display->xroot,
|
||||||
&ignored1, &ignored2, &children, &n_children);
|
&ignored1, &ignored2, &children, &n_children);
|
||||||
|
|
||||||
tracker->verified_stack = g_array_sized_new (FALSE, FALSE, sizeof (guint64), n_children);
|
old_len = tracker->verified_stack->len;
|
||||||
g_array_set_size (tracker->verified_stack, n_children);
|
|
||||||
|
g_array_set_size (tracker->verified_stack, old_len + n_children);
|
||||||
|
|
||||||
for (i = 0; i < n_children; i++)
|
for (i = 0; i < n_children; i++)
|
||||||
g_array_index (tracker->verified_stack, guint64, i) = children[i];
|
g_array_index (tracker->verified_stack, guint64, old_len + i) = children[i];
|
||||||
|
|
||||||
XFree (children);
|
XFree (children);
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaStackTracker *
|
MetaStackTracker *
|
||||||
meta_stack_tracker_new (MetaScreen *screen)
|
meta_stack_tracker_new (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaStackTracker *tracker;
|
MetaStackTracker *tracker;
|
||||||
|
|
||||||
tracker = g_new0 (MetaStackTracker, 1);
|
tracker = g_new0 (MetaStackTracker, 1);
|
||||||
tracker->screen = screen;
|
tracker->display = display;
|
||||||
|
|
||||||
query_xserver_stack (tracker);
|
|
||||||
|
|
||||||
|
tracker->verified_stack = g_array_new (FALSE, FALSE, sizeof (guint64));
|
||||||
tracker->unverified_predictions = g_queue_new ();
|
tracker->unverified_predictions = g_queue_new ();
|
||||||
|
|
||||||
|
g_signal_connect (display,
|
||||||
|
"x11-display-opened",
|
||||||
|
G_CALLBACK (query_xserver_stack),
|
||||||
|
tracker);
|
||||||
|
|
||||||
meta_stack_tracker_dump (tracker);
|
meta_stack_tracker_dump (tracker);
|
||||||
|
|
||||||
return tracker;
|
return tracker;
|
||||||
@@ -528,6 +536,10 @@ meta_stack_tracker_free (MetaStackTracker *tracker)
|
|||||||
g_queue_free (tracker->unverified_predictions);
|
g_queue_free (tracker->unverified_predictions);
|
||||||
tracker->unverified_predictions = NULL;
|
tracker->unverified_predictions = NULL;
|
||||||
|
|
||||||
|
g_signal_handlers_disconnect_by_func (tracker->display,
|
||||||
|
(gpointer)query_xserver_stack,
|
||||||
|
tracker);
|
||||||
|
|
||||||
g_free (tracker);
|
g_free (tracker);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -849,8 +861,9 @@ meta_stack_tracker_sync_stack (MetaStackTracker *tracker)
|
|||||||
|
|
||||||
if (META_STACK_ID_IS_X11 (window))
|
if (META_STACK_ID_IS_X11 (window))
|
||||||
{
|
{
|
||||||
|
MetaX11Display *x11_display = tracker->display->x11_display;
|
||||||
MetaWindow *meta_window =
|
MetaWindow *meta_window =
|
||||||
meta_display_lookup_x_window (tracker->screen->display, (Window)window);
|
meta_x11_display_lookup_x_window (x11_display, (Window)window);
|
||||||
|
|
||||||
/* When mapping back from xwindow to MetaWindow we have to be a bit careful;
|
/* When mapping back from xwindow to MetaWindow we have to be a bit careful;
|
||||||
* children of the root could include unmapped windows created by toolkits
|
* children of the root could include unmapped windows created by toolkits
|
||||||
@@ -865,14 +878,14 @@ meta_stack_tracker_sync_stack (MetaStackTracker *tracker)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
meta_windows = g_list_prepend (meta_windows,
|
meta_windows = g_list_prepend (meta_windows,
|
||||||
meta_display_lookup_stamp (tracker->screen->display, window));
|
meta_display_lookup_stamp (tracker->display, window));
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_compositor_sync_stack (tracker->screen->display->compositor,
|
meta_compositor_sync_stack (tracker->display->compositor,
|
||||||
meta_windows);
|
meta_windows);
|
||||||
g_list_free (meta_windows);
|
g_list_free (meta_windows);
|
||||||
|
|
||||||
meta_screen_restacked (tracker->screen);
|
meta_display_restacked (tracker->display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -977,6 +990,7 @@ meta_stack_tracker_lower_below (MetaStackTracker *tracker,
|
|||||||
guint64 sibling)
|
guint64 sibling)
|
||||||
{
|
{
|
||||||
gulong serial = 0;
|
gulong serial = 0;
|
||||||
|
MetaX11Display *x11_display = tracker->display->x11_display;
|
||||||
|
|
||||||
if (META_STACK_ID_IS_X11 (window))
|
if (META_STACK_ID_IS_X11 (window))
|
||||||
{
|
{
|
||||||
@@ -985,18 +999,18 @@ meta_stack_tracker_lower_below (MetaStackTracker *tracker,
|
|||||||
|
|
||||||
if (changes.sibling != find_x11_sibling_upwards (tracker, window))
|
if (changes.sibling != find_x11_sibling_upwards (tracker, window))
|
||||||
{
|
{
|
||||||
serial = XNextRequest (tracker->screen->display->xdisplay);
|
serial = XNextRequest (x11_display->xdisplay);
|
||||||
|
|
||||||
meta_error_trap_push (tracker->screen->display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
|
|
||||||
changes.stack_mode = changes.sibling ? Below : Above;
|
changes.stack_mode = changes.sibling ? Below : Above;
|
||||||
|
|
||||||
XConfigureWindow (tracker->screen->display->xdisplay,
|
XConfigureWindow (x11_display->xdisplay,
|
||||||
window,
|
window,
|
||||||
(changes.sibling ? CWSibling : 0) | CWStackMode,
|
(changes.sibling ? CWSibling : 0) | CWStackMode,
|
||||||
&changes);
|
&changes);
|
||||||
|
|
||||||
meta_error_trap_pop (tracker->screen->display);
|
meta_x11_error_trap_pop (x11_display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1011,6 +1025,7 @@ meta_stack_tracker_raise_above (MetaStackTracker *tracker,
|
|||||||
guint64 sibling)
|
guint64 sibling)
|
||||||
{
|
{
|
||||||
gulong serial = 0;
|
gulong serial = 0;
|
||||||
|
MetaX11Display *x11_display = tracker->display->x11_display;
|
||||||
|
|
||||||
if (META_STACK_ID_IS_X11 (window))
|
if (META_STACK_ID_IS_X11 (window))
|
||||||
{
|
{
|
||||||
@@ -1019,18 +1034,18 @@ meta_stack_tracker_raise_above (MetaStackTracker *tracker,
|
|||||||
|
|
||||||
if (changes.sibling != find_x11_sibling_downwards (tracker, window))
|
if (changes.sibling != find_x11_sibling_downwards (tracker, window))
|
||||||
{
|
{
|
||||||
serial = XNextRequest (tracker->screen->display->xdisplay);
|
serial = XNextRequest (x11_display->xdisplay);
|
||||||
|
|
||||||
meta_error_trap_push (tracker->screen->display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
|
|
||||||
changes.stack_mode = changes.sibling ? Above : Below;
|
changes.stack_mode = changes.sibling ? Above : Below;
|
||||||
|
|
||||||
XConfigureWindow (tracker->screen->display->xdisplay,
|
XConfigureWindow (x11_display->xdisplay,
|
||||||
(Window)window,
|
(Window)window,
|
||||||
(changes.sibling ? CWSibling : 0) | CWStackMode,
|
(changes.sibling ? CWSibling : 0) | CWStackMode,
|
||||||
&changes);
|
&changes);
|
||||||
|
|
||||||
meta_error_trap_pop (tracker->screen->display);
|
meta_x11_error_trap_pop (x11_display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1057,7 +1072,7 @@ meta_stack_tracker_keep_override_redirect_on_top (MetaStackTracker *tracker)
|
|||||||
|
|
||||||
for (i = n_windows - 1; i >= 0; i--)
|
for (i = n_windows - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
window = meta_display_lookup_stack_id (tracker->screen->display, stack[i]);
|
window = meta_display_lookup_stack_id (tracker->display, stack[i]);
|
||||||
if (window && window->layer != META_LAYER_OVERRIDE_REDIRECT)
|
if (window && window->layer != META_LAYER_OVERRIDE_REDIRECT)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1066,7 +1081,7 @@ meta_stack_tracker_keep_override_redirect_on_top (MetaStackTracker *tracker)
|
|||||||
|
|
||||||
for (i -= 1; i >= 0; i--)
|
for (i -= 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
window = meta_display_lookup_stack_id (tracker->screen->display, stack[i]);
|
window = meta_display_lookup_stack_id (tracker->display, stack[i]);
|
||||||
if (window && window->layer == META_LAYER_OVERRIDE_REDIRECT)
|
if (window && window->layer == META_LAYER_OVERRIDE_REDIRECT)
|
||||||
{
|
{
|
||||||
meta_stack_tracker_raise_above (tracker, stack[i], stack[topmost_non_or]);
|
meta_stack_tracker_raise_above (tracker, stack[i], stack[topmost_non_or]);
|
||||||
@@ -1098,9 +1113,9 @@ meta_stack_tracker_restack_managed (MetaStackTracker *tracker,
|
|||||||
old_pos = n_windows - 1;
|
old_pos = n_windows - 1;
|
||||||
for (old_pos = n_windows - 1; old_pos >= 0; old_pos--)
|
for (old_pos = n_windows - 1; old_pos >= 0; old_pos--)
|
||||||
{
|
{
|
||||||
MetaWindow *old_window = meta_display_lookup_stack_id (tracker->screen->display, windows[old_pos]);
|
MetaWindow *old_window = meta_display_lookup_stack_id (tracker->display, windows[old_pos]);
|
||||||
if ((old_window && !old_window->override_redirect && !old_window->unmanaging) ||
|
if ((old_window && !old_window->override_redirect && !old_window->unmanaging) ||
|
||||||
windows[old_pos] == tracker->screen->guard_window)
|
windows[old_pos] == tracker->display->x11_display->guard_window)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
g_assert (old_pos >= 0);
|
g_assert (old_pos >= 0);
|
||||||
@@ -1119,7 +1134,7 @@ meta_stack_tracker_restack_managed (MetaStackTracker *tracker,
|
|||||||
|
|
||||||
while (old_pos >= 0 && new_pos >= 0)
|
while (old_pos >= 0 && new_pos >= 0)
|
||||||
{
|
{
|
||||||
if (windows[old_pos] == tracker->screen->guard_window)
|
if (windows[old_pos] == tracker->display->x11_display->guard_window)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (windows[old_pos] == managed[new_pos])
|
if (windows[old_pos] == managed[new_pos])
|
||||||
@@ -1129,7 +1144,7 @@ meta_stack_tracker_restack_managed (MetaStackTracker *tracker,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaWindow *old_window = meta_display_lookup_stack_id (tracker->screen->display, windows[old_pos]);
|
MetaWindow *old_window = meta_display_lookup_stack_id (tracker->display, windows[old_pos]);
|
||||||
if (!old_window || old_window->override_redirect || old_window->unmanaging)
|
if (!old_window || old_window->override_redirect || old_window->unmanaging)
|
||||||
{
|
{
|
||||||
old_pos--;
|
old_pos--;
|
||||||
|
|||||||
@@ -34,12 +34,12 @@
|
|||||||
#ifndef META_STACK_TRACKER_H
|
#ifndef META_STACK_TRACKER_H
|
||||||
#define META_STACK_TRACKER_H
|
#define META_STACK_TRACKER_H
|
||||||
|
|
||||||
#include <meta/screen.h>
|
#include <meta/display.h>
|
||||||
#include <meta/window.h>
|
#include <meta/window.h>
|
||||||
|
|
||||||
typedef struct _MetaStackTracker MetaStackTracker;
|
typedef struct _MetaStackTracker MetaStackTracker;
|
||||||
|
|
||||||
MetaStackTracker *meta_stack_tracker_new (MetaScreen *screen);
|
MetaStackTracker *meta_stack_tracker_new (MetaDisplay *display);
|
||||||
void meta_stack_tracker_free (MetaStackTracker *tracker);
|
void meta_stack_tracker_free (MetaStackTracker *tracker);
|
||||||
|
|
||||||
/* These functions are called when we make an X call that changes the
|
/* These functions are called when we make an X call that changes the
|
||||||
|
|||||||
@@ -27,8 +27,9 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
|
#include "meta-workspace-manager-private.h"
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include <meta/group.h>
|
#include <meta/group.h>
|
||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
@@ -37,6 +38,7 @@
|
|||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
#include "x11/group-private.h"
|
#include "x11/group-private.h"
|
||||||
|
|
||||||
#define WINDOW_HAS_TRANSIENT_TYPE(w) \
|
#define WINDOW_HAS_TRANSIENT_TYPE(w) \
|
||||||
@@ -62,14 +64,14 @@ static void stack_do_resort (MetaStack *stack);
|
|||||||
|
|
||||||
static void stack_ensure_sorted (MetaStack *stack);
|
static void stack_ensure_sorted (MetaStack *stack);
|
||||||
|
|
||||||
MetaStack*
|
MetaStack *
|
||||||
meta_stack_new (MetaScreen *screen)
|
meta_stack_new (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
MetaStack *stack;
|
MetaStack *stack;
|
||||||
|
|
||||||
stack = g_new (MetaStack, 1);
|
stack = g_new (MetaStack, 1);
|
||||||
|
|
||||||
stack->screen = screen;
|
stack->display = display;
|
||||||
stack->xwindows = g_array_new (FALSE, FALSE, sizeof (Window));
|
stack->xwindows = g_array_new (FALSE, FALSE, sizeof (Window));
|
||||||
|
|
||||||
stack->sorted = NULL;
|
stack->sorted = NULL;
|
||||||
@@ -102,6 +104,8 @@ void
|
|||||||
meta_stack_add (MetaStack *stack,
|
meta_stack_add (MetaStack *stack,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
g_return_if_fail (!window->override_redirect);
|
g_return_if_fail (!window->override_redirect);
|
||||||
|
|
||||||
meta_topic (META_DEBUG_STACK, "Adding window %s to the stack\n", window->desc);
|
meta_topic (META_DEBUG_STACK, "Adding window %s to the stack\n", window->desc);
|
||||||
@@ -118,13 +122,15 @@ meta_stack_add (MetaStack *stack,
|
|||||||
window->desc, window->stack_position);
|
window->desc, window->stack_position);
|
||||||
|
|
||||||
stack_sync_to_xserver (stack);
|
stack_sync_to_xserver (stack);
|
||||||
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
|
meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_stack_remove (MetaStack *stack,
|
meta_stack_remove (MetaStack *stack,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
meta_topic (META_DEBUG_STACK, "Removing window %s from the stack\n", window->desc);
|
meta_topic (META_DEBUG_STACK, "Removing window %s from the stack\n", window->desc);
|
||||||
|
|
||||||
if (window->stack_position < 0)
|
if (window->stack_position < 0)
|
||||||
@@ -158,27 +164,29 @@ meta_stack_remove (MetaStack *stack,
|
|||||||
}
|
}
|
||||||
|
|
||||||
stack_sync_to_xserver (stack);
|
stack_sync_to_xserver (stack);
|
||||||
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
|
meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_stack_update_layer (MetaStack *stack,
|
meta_stack_update_layer (MetaStack *stack,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
stack->need_relayer = TRUE;
|
stack->need_relayer = TRUE;
|
||||||
|
|
||||||
stack_sync_to_xserver (stack);
|
stack_sync_to_xserver (stack);
|
||||||
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
|
meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_stack_update_transient (MetaStack *stack,
|
meta_stack_update_transient (MetaStack *stack,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
stack->need_constrain = TRUE;
|
stack->need_constrain = TRUE;
|
||||||
|
|
||||||
stack_sync_to_xserver (stack);
|
stack_sync_to_xserver (stack);
|
||||||
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
|
meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* raise/lower within a layer */
|
/* raise/lower within a layer */
|
||||||
@@ -186,6 +194,7 @@ void
|
|||||||
meta_stack_raise (MetaStack *stack,
|
meta_stack_raise (MetaStack *stack,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
GList *l;
|
GList *l;
|
||||||
int max_stack_position = window->stack_position;
|
int max_stack_position = window->stack_position;
|
||||||
MetaWorkspace *workspace;
|
MetaWorkspace *workspace;
|
||||||
@@ -207,13 +216,14 @@ meta_stack_raise (MetaStack *stack,
|
|||||||
meta_window_set_stack_position_no_sync (window, max_stack_position);
|
meta_window_set_stack_position_no_sync (window, max_stack_position);
|
||||||
|
|
||||||
stack_sync_to_xserver (stack);
|
stack_sync_to_xserver (stack);
|
||||||
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
|
meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_stack_lower (MetaStack *stack,
|
meta_stack_lower (MetaStack *stack,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
GList *l;
|
GList *l;
|
||||||
int min_stack_position = window->stack_position;
|
int min_stack_position = window->stack_position;
|
||||||
MetaWorkspace *workspace;
|
MetaWorkspace *workspace;
|
||||||
@@ -235,7 +245,7 @@ meta_stack_lower (MetaStack *stack,
|
|||||||
meta_window_set_stack_position_no_sync (window, min_stack_position);
|
meta_window_set_stack_position_no_sync (window, min_stack_position);
|
||||||
|
|
||||||
stack_sync_to_xserver (stack);
|
stack_sync_to_xserver (stack);
|
||||||
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
|
meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -496,8 +506,6 @@ add_constraint (Constraint **constraints,
|
|||||||
{
|
{
|
||||||
Constraint *c;
|
Constraint *c;
|
||||||
|
|
||||||
g_assert (above->screen == below->screen);
|
|
||||||
|
|
||||||
/* check if constraint is a duplicate */
|
/* check if constraint is a duplicate */
|
||||||
c = constraints[below->stack_position];
|
c = constraints[below->stack_position];
|
||||||
while (c != NULL)
|
while (c != NULL)
|
||||||
@@ -558,7 +566,6 @@ create_constraints (Constraint **constraints,
|
|||||||
MetaWindow *group_window = tmp2->data;
|
MetaWindow *group_window = tmp2->data;
|
||||||
|
|
||||||
if (!WINDOW_IN_STACK (group_window) ||
|
if (!WINDOW_IN_STACK (group_window) ||
|
||||||
w->screen != group_window->screen ||
|
|
||||||
group_window->override_redirect)
|
group_window->override_redirect)
|
||||||
{
|
{
|
||||||
tmp2 = tmp2->next;
|
tmp2 = tmp2->next;
|
||||||
@@ -950,7 +957,7 @@ stack_do_resort (MetaStack *stack)
|
|||||||
stack->sorted = g_list_sort (stack->sorted,
|
stack->sorted = g_list_sort (stack->sorted,
|
||||||
(GCompareFunc) compare_window_position);
|
(GCompareFunc) compare_window_position);
|
||||||
|
|
||||||
meta_screen_queue_check_fullscreen (stack->screen);
|
meta_display_queue_check_fullscreen (stack->display);
|
||||||
|
|
||||||
stack->need_resort = FALSE;
|
stack->need_resort = FALSE;
|
||||||
}
|
}
|
||||||
@@ -1057,7 +1064,7 @@ stack_sync_to_xserver (MetaStack *stack)
|
|||||||
|
|
||||||
/* The screen guard window sits above all hidden windows and acts as
|
/* The screen guard window sits above all hidden windows and acts as
|
||||||
* a barrier to input reaching these windows. */
|
* a barrier to input reaching these windows. */
|
||||||
guint64 guard_window_id = stack->screen->guard_window;
|
guint64 guard_window_id = stack->display->x11_display->guard_window;
|
||||||
g_array_append_val (hidden_stack_ids, guard_window_id);
|
g_array_append_val (hidden_stack_ids, guard_window_id);
|
||||||
|
|
||||||
/* Sync to server */
|
/* Sync to server */
|
||||||
@@ -1065,25 +1072,25 @@ stack_sync_to_xserver (MetaStack *stack)
|
|||||||
meta_topic (META_DEBUG_STACK, "Restacking %u windows\n",
|
meta_topic (META_DEBUG_STACK, "Restacking %u windows\n",
|
||||||
all_root_children_stacked->len);
|
all_root_children_stacked->len);
|
||||||
|
|
||||||
meta_stack_tracker_restack_managed (stack->screen->stack_tracker,
|
meta_stack_tracker_restack_managed (stack->display->stack_tracker,
|
||||||
(guint64 *)all_root_children_stacked->data,
|
(guint64 *)all_root_children_stacked->data,
|
||||||
all_root_children_stacked->len);
|
all_root_children_stacked->len);
|
||||||
meta_stack_tracker_restack_at_bottom (stack->screen->stack_tracker,
|
meta_stack_tracker_restack_at_bottom (stack->display->stack_tracker,
|
||||||
(guint64 *)hidden_stack_ids->data,
|
(guint64 *)hidden_stack_ids->data,
|
||||||
hidden_stack_ids->len);
|
hidden_stack_ids->len);
|
||||||
|
|
||||||
/* Sync _NET_CLIENT_LIST and _NET_CLIENT_LIST_STACKING */
|
/* Sync _NET_CLIENT_LIST and _NET_CLIENT_LIST_STACKING */
|
||||||
|
|
||||||
XChangeProperty (stack->screen->display->xdisplay,
|
XChangeProperty (stack->display->x11_display->xdisplay,
|
||||||
stack->screen->xroot,
|
stack->display->x11_display->xroot,
|
||||||
stack->screen->display->atom__NET_CLIENT_LIST,
|
stack->display->x11_display->atom__NET_CLIENT_LIST,
|
||||||
XA_WINDOW,
|
XA_WINDOW,
|
||||||
32, PropModeReplace,
|
32, PropModeReplace,
|
||||||
(unsigned char *)stack->xwindows->data,
|
(unsigned char *)stack->xwindows->data,
|
||||||
stack->xwindows->len);
|
stack->xwindows->len);
|
||||||
XChangeProperty (stack->screen->display->xdisplay,
|
XChangeProperty (stack->display->x11_display->xdisplay,
|
||||||
stack->screen->xroot,
|
stack->display->x11_display->xroot,
|
||||||
stack->screen->display->atom__NET_CLIENT_LIST_STACKING,
|
stack->display->x11_display->atom__NET_CLIENT_LIST_STACKING,
|
||||||
XA_WINDOW,
|
XA_WINDOW,
|
||||||
32, PropModeReplace,
|
32, PropModeReplace,
|
||||||
(unsigned char *)x11_stacked->data,
|
(unsigned char *)x11_stacked->data,
|
||||||
@@ -1286,8 +1293,6 @@ meta_stack_windows_cmp (MetaStack *stack,
|
|||||||
MetaWindow *window_a,
|
MetaWindow *window_a,
|
||||||
MetaWindow *window_b)
|
MetaWindow *window_b)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (window_a->screen == window_b->screen, 0);
|
|
||||||
|
|
||||||
/* -1 means a below b */
|
/* -1 means a below b */
|
||||||
|
|
||||||
stack_ensure_sorted (stack); /* update constraints, layers */
|
stack_ensure_sorted (stack); /* update constraints, layers */
|
||||||
@@ -1416,10 +1421,10 @@ meta_window_set_stack_position_no_sync (MetaWindow *window,
|
|||||||
int low, high, delta;
|
int low, high, delta;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
|
||||||
g_return_if_fail (window->screen->stack != NULL);
|
g_return_if_fail (window->display->stack != NULL);
|
||||||
g_return_if_fail (window->stack_position >= 0);
|
g_return_if_fail (window->stack_position >= 0);
|
||||||
g_return_if_fail (position >= 0);
|
g_return_if_fail (position >= 0);
|
||||||
g_return_if_fail (position < window->screen->stack->n_positions);
|
g_return_if_fail (position < window->display->stack->n_positions);
|
||||||
|
|
||||||
if (position == window->stack_position)
|
if (position == window->stack_position)
|
||||||
{
|
{
|
||||||
@@ -1428,8 +1433,8 @@ meta_window_set_stack_position_no_sync (MetaWindow *window,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window->screen->stack->need_resort = TRUE;
|
window->display->stack->need_resort = TRUE;
|
||||||
window->screen->stack->need_constrain = TRUE;
|
window->display->stack->need_constrain = TRUE;
|
||||||
|
|
||||||
if (position < window->stack_position)
|
if (position < window->stack_position)
|
||||||
{
|
{
|
||||||
@@ -1444,7 +1449,7 @@ meta_window_set_stack_position_no_sync (MetaWindow *window,
|
|||||||
delta = -1;
|
delta = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = window->screen->stack->sorted;
|
tmp = window->display->stack->sorted;
|
||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
{
|
{
|
||||||
MetaWindow *w = tmp->data;
|
MetaWindow *w = tmp->data;
|
||||||
@@ -1467,8 +1472,10 @@ void
|
|||||||
meta_window_set_stack_position (MetaWindow *window,
|
meta_window_set_stack_position (MetaWindow *window,
|
||||||
int position)
|
int position)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
meta_window_set_stack_position_no_sync (window, position);
|
meta_window_set_stack_position_no_sync (window, position);
|
||||||
stack_sync_to_xserver (window->screen->stack);
|
stack_sync_to_xserver (window->display->stack);
|
||||||
meta_stack_update_window_tile_matches (window->screen->stack,
|
meta_stack_update_window_tile_matches (window->display->stack,
|
||||||
window->screen->active_workspace);
|
workspace_manager->active_workspace);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
* by layer, then by stack_position within each layer.
|
* by layer, then by stack_position within each layer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "screen-private.h"
|
#include "display-private.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A sorted list of windows bearing some level of resemblance to the stack of
|
* A sorted list of windows bearing some level of resemblance to the stack of
|
||||||
@@ -51,8 +51,8 @@
|
|||||||
*/
|
*/
|
||||||
struct _MetaStack
|
struct _MetaStack
|
||||||
{
|
{
|
||||||
/** The MetaScreen containing this stack. */
|
/** The MetaDisplay containing this stack. */
|
||||||
MetaScreen *screen;
|
MetaDisplay *display;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A sequence of all the Windows (X handles, not MetaWindows) of the windows
|
* A sequence of all the Windows (X handles, not MetaWindows) of the windows
|
||||||
@@ -123,13 +123,13 @@ struct _MetaStack
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_stack_new:
|
* meta_stack_new:
|
||||||
* @screen: The MetaScreen which will be the parent of this stack.
|
* @display: The MetaDisplay which will be the parent of this stack.
|
||||||
*
|
*
|
||||||
* Creates and initialises a MetaStack.
|
* Creates and initialises a MetaStack.
|
||||||
*
|
*
|
||||||
* Returns: The new screen.
|
* Returns: The new stack.
|
||||||
*/
|
*/
|
||||||
MetaStack *meta_stack_new (MetaScreen *screen);
|
MetaStack *meta_stack_new (MetaDisplay *display);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_stack_free:
|
* meta_stack_free:
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "display-private.h"
|
#include "display-private.h"
|
||||||
#include "screen-private.h"
|
#include "x11/meta-x11-display-private.h"
|
||||||
#include "startup-notification-private.h"
|
#include "startup-notification-private.h"
|
||||||
|
|
||||||
/* This should be fairly long, as it should never be required unless
|
/* This should be fairly long, as it should never be required unless
|
||||||
@@ -143,19 +143,19 @@ static void meta_startup_notification_ensure_timeout (MetaStartupNotification *
|
|||||||
static void
|
static void
|
||||||
meta_startup_notification_update_feedback (MetaStartupNotification *sn)
|
meta_startup_notification_update_feedback (MetaStartupNotification *sn)
|
||||||
{
|
{
|
||||||
MetaScreen *screen = sn->display->screen;
|
MetaDisplay *display = sn->display;
|
||||||
|
|
||||||
if (sn->startup_sequences != NULL)
|
if (sn->startup_sequences != NULL)
|
||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_STARTUP,
|
meta_topic (META_DEBUG_STARTUP,
|
||||||
"Setting busy cursor\n");
|
"Setting busy cursor\n");
|
||||||
meta_screen_set_cursor (screen, META_CURSOR_BUSY);
|
meta_display_set_cursor (display, META_CURSOR_BUSY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_STARTUP,
|
meta_topic (META_DEBUG_STARTUP,
|
||||||
"Setting default cursor\n");
|
"Setting default cursor\n");
|
||||||
meta_screen_set_cursor (screen, META_CURSOR_DEFAULT);
|
meta_display_set_cursor (display, META_CURSOR_DEFAULT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -528,11 +528,6 @@ meta_startup_notification_finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
MetaStartupNotification *sn = META_STARTUP_NOTIFICATION (object);
|
MetaStartupNotification *sn = META_STARTUP_NOTIFICATION (object);
|
||||||
|
|
||||||
#ifdef HAVE_STARTUP_NOTIFICATION
|
|
||||||
sn_monitor_context_unref (sn->sn_context);
|
|
||||||
sn_display_unref (sn->sn_display);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (sn->startup_sequence_timeout)
|
if (sn->startup_sequence_timeout)
|
||||||
g_source_remove (sn->startup_sequence_timeout);
|
g_source_remove (sn->startup_sequence_timeout);
|
||||||
|
|
||||||
@@ -589,7 +584,7 @@ sn_error_trap_push (SnDisplay *sn_display,
|
|||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
display = meta_display_for_x_display (xdisplay);
|
display = meta_display_for_x_display (xdisplay);
|
||||||
if (display != NULL)
|
if (display != NULL)
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -599,7 +594,7 @@ sn_error_trap_pop (SnDisplay *sn_display,
|
|||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
display = meta_display_for_x_display (xdisplay);
|
display = meta_display_for_x_display (xdisplay);
|
||||||
if (display != NULL)
|
if (display != NULL)
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (display->x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -660,6 +655,33 @@ meta_startup_notification_sn_event (SnMonitorEvent *event,
|
|||||||
|
|
||||||
sn_startup_sequence_unref (sequence);
|
sn_startup_sequence_unref (sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_x11_display_opened (MetaStartupNotification *sn)
|
||||||
|
{
|
||||||
|
MetaX11Display *x11_display = sn->display->x11_display;
|
||||||
|
|
||||||
|
sn->sn_display = sn_display_new (x11_display->xdisplay,
|
||||||
|
sn_error_trap_push,
|
||||||
|
sn_error_trap_pop);
|
||||||
|
|
||||||
|
sn->sn_context =
|
||||||
|
sn_monitor_context_new (sn->sn_display,
|
||||||
|
meta_x11_display_get_screen_number (x11_display),
|
||||||
|
meta_startup_notification_sn_event,
|
||||||
|
sn,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_x11_display_closing (MetaStartupNotification *sn)
|
||||||
|
{
|
||||||
|
sn_monitor_context_unref (sn->sn_context);
|
||||||
|
sn->sn_context = NULL;
|
||||||
|
|
||||||
|
sn_display_unref (sn->sn_display);
|
||||||
|
sn->sn_display = NULL;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -670,16 +692,22 @@ meta_startup_notification_constructed (GObject *object)
|
|||||||
g_assert (sn->display != NULL);
|
g_assert (sn->display != NULL);
|
||||||
|
|
||||||
#ifdef HAVE_STARTUP_NOTIFICATION
|
#ifdef HAVE_STARTUP_NOTIFICATION
|
||||||
sn->sn_display = sn_display_new (sn->display->xdisplay,
|
sn->sn_display = NULL;
|
||||||
sn_error_trap_push,
|
sn->sn_context = NULL;
|
||||||
sn_error_trap_pop);
|
|
||||||
sn->sn_context =
|
g_signal_connect_object (sn->display,
|
||||||
sn_monitor_context_new (sn->sn_display,
|
"x11-display-opened",
|
||||||
meta_ui_get_screen_number (),
|
G_CALLBACK (on_x11_display_opened),
|
||||||
meta_startup_notification_sn_event,
|
sn,
|
||||||
sn,
|
G_CONNECT_SWAPPED);
|
||||||
NULL);
|
|
||||||
|
g_signal_connect_object (sn->display,
|
||||||
|
"x11-display-closing",
|
||||||
|
G_CALLBACK (on_x11_display_closing),
|
||||||
|
sn,
|
||||||
|
G_CONNECT_SWAPPED);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sn->startup_sequences = NULL;
|
sn->startup_sequences = NULL;
|
||||||
sn->startup_sequence_timeout = 0;
|
sn->startup_sequence_timeout = 0;
|
||||||
}
|
}
|
||||||
@@ -753,6 +781,9 @@ meta_startup_notification_get_sequences (MetaStartupNotification *sn)
|
|||||||
#ifdef HAVE_STARTUP_NOTIFICATION
|
#ifdef HAVE_STARTUP_NOTIFICATION
|
||||||
GSList *l;
|
GSList *l;
|
||||||
|
|
||||||
|
if (!sn->sn_display)
|
||||||
|
return sequences;
|
||||||
|
|
||||||
/* We return a list of SnStartupSequences here */
|
/* We return a list of SnStartupSequences here */
|
||||||
for (l = sn->startup_sequences; l; l = l->next)
|
for (l = sn->startup_sequences; l; l = l->next)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
#include <meta/compositor.h>
|
#include <meta/compositor.h>
|
||||||
#include <meta/window.h>
|
#include <meta/window.h>
|
||||||
#include <meta/meta-close-dialog.h>
|
#include <meta/meta-close-dialog.h>
|
||||||
#include "screen-private.h"
|
#include "backends/meta-logical-monitor.h"
|
||||||
#include <meta/util.h>
|
#include <meta/util.h>
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
@@ -134,7 +134,6 @@ struct _MetaWindow
|
|||||||
GObject parent_instance;
|
GObject parent_instance;
|
||||||
|
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
MetaScreen *screen;
|
|
||||||
guint64 stamp;
|
guint64 stamp;
|
||||||
MetaLogicalMonitor *monitor;
|
MetaLogicalMonitor *monitor;
|
||||||
MetaWorkspace *workspace;
|
MetaWorkspace *workspace;
|
||||||
@@ -567,7 +566,6 @@ struct _MetaWindowClass
|
|||||||
#define META_WINDOW_ALLOWS_VERTICAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_height < (w)->size_hints.max_height)
|
#define META_WINDOW_ALLOWS_VERTICAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_height < (w)->size_hints.max_height)
|
||||||
|
|
||||||
MetaWindow * _meta_window_shared_new (MetaDisplay *display,
|
MetaWindow * _meta_window_shared_new (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindowClientType client_type,
|
MetaWindowClientType client_type,
|
||||||
MetaWaylandSurface *surface,
|
MetaWaylandSurface *surface,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
#include "edge-resistance.h"
|
#include "edge-resistance.h"
|
||||||
#include "util-private.h"
|
#include "util-private.h"
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
|
#include "meta-workspace-manager-private.h"
|
||||||
#include "workspace-private.h"
|
#include "workspace-private.h"
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
#include "keybindings-private.h"
|
#include "keybindings-private.h"
|
||||||
@@ -52,6 +53,7 @@
|
|||||||
#include <meta/meta-cursor-tracker.h>
|
#include <meta/meta-cursor-tracker.h>
|
||||||
#include "meta/compositor-mutter.h"
|
#include "meta/compositor-mutter.h"
|
||||||
|
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
#include "x11/window-x11.h"
|
#include "x11/window-x11.h"
|
||||||
#include "x11/window-props.h"
|
#include "x11/window-props.h"
|
||||||
#include "x11/xprops.h"
|
#include "x11/xprops.h"
|
||||||
@@ -679,9 +681,10 @@ is_desktop_or_dock_foreach (MetaWindow *window,
|
|||||||
static void
|
static void
|
||||||
maybe_leave_show_desktop_mode (MetaWindow *window)
|
maybe_leave_show_desktop_mode (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
gboolean is_desktop_or_dock;
|
gboolean is_desktop_or_dock;
|
||||||
|
|
||||||
if (!window->screen->active_workspace->showing_desktop)
|
if (!workspace_manager->active_workspace->showing_desktop)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* If the window is a transient for the dock or desktop, don't
|
/* If the window is a transient for the dock or desktop, don't
|
||||||
@@ -698,9 +701,9 @@ maybe_leave_show_desktop_mode (MetaWindow *window)
|
|||||||
|
|
||||||
if (!is_desktop_or_dock)
|
if (!is_desktop_or_dock)
|
||||||
{
|
{
|
||||||
meta_screen_minimize_all_on_active_workspace_except (window->screen,
|
meta_workspace_manager_minimize_all_on_active_workspace_except (workspace_manager,
|
||||||
window);
|
window);
|
||||||
meta_screen_unshow_desktop (window->screen);
|
meta_workspace_manager_unshow_desktop (workspace_manager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -753,17 +756,17 @@ sync_client_window_mapped (MetaWindow *window)
|
|||||||
|
|
||||||
window->mapped = should_be_mapped;
|
window->mapped = should_be_mapped;
|
||||||
|
|
||||||
meta_error_trap_push (window->display);
|
meta_x11_error_trap_push (window->display->x11_display);
|
||||||
if (should_be_mapped)
|
if (should_be_mapped)
|
||||||
{
|
{
|
||||||
XMapWindow (window->display->xdisplay, window->xwindow);
|
XMapWindow (window->display->x11_display->xdisplay, window->xwindow);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
XUnmapWindow (window->display->xdisplay, window->xwindow);
|
XUnmapWindow (window->display->x11_display->xdisplay, window->xwindow);
|
||||||
window->unmaps_pending ++;
|
window->unmaps_pending ++;
|
||||||
}
|
}
|
||||||
meta_error_trap_pop (window->display);
|
meta_x11_error_trap_pop (window->display->x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -823,10 +826,10 @@ meta_window_main_monitor_changed (MetaWindow *window,
|
|||||||
META_WINDOW_GET_CLASS (window)->main_monitor_changed (window, old);
|
META_WINDOW_GET_CLASS (window)->main_monitor_changed (window, old);
|
||||||
|
|
||||||
if (old)
|
if (old)
|
||||||
g_signal_emit_by_name (window->screen, "window-left-monitor",
|
g_signal_emit_by_name (window->display, "window-left-monitor",
|
||||||
old->number, window);
|
old->number, window);
|
||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
g_signal_emit_by_name (window->screen, "window-entered-monitor",
|
g_signal_emit_by_name (window->display, "window-entered-monitor",
|
||||||
window->monitor->number, window);
|
window->monitor->number, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -845,7 +848,6 @@ meta_window_calculate_main_logical_monitor (MetaWindow *window)
|
|||||||
|
|
||||||
MetaWindow *
|
MetaWindow *
|
||||||
_meta_window_shared_new (MetaDisplay *display,
|
_meta_window_shared_new (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindowClientType client_type,
|
MetaWindowClientType client_type,
|
||||||
MetaWaylandSurface *surface,
|
MetaWaylandSurface *surface,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
@@ -853,6 +855,7 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
MetaCompEffect effect,
|
MetaCompEffect effect,
|
||||||
XWindowAttributes *attrs)
|
XWindowAttributes *attrs)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
g_assert (attrs != NULL);
|
g_assert (attrs != NULL);
|
||||||
@@ -882,9 +885,6 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
window->surface = surface;
|
window->surface = surface;
|
||||||
window->xwindow = xwindow;
|
window->xwindow = xwindow;
|
||||||
|
|
||||||
/* this is in window->screen->display, but that's too annoying to
|
|
||||||
* type
|
|
||||||
*/
|
|
||||||
window->display = display;
|
window->display = display;
|
||||||
meta_display_register_stamp (window->display, &window->stamp, window);
|
meta_display_register_stamp (window->display, &window->stamp, window);
|
||||||
|
|
||||||
@@ -895,15 +895,13 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
window->sync_request_timeout_id = 0;
|
window->sync_request_timeout_id = 0;
|
||||||
window->sync_request_alarm = None;
|
window->sync_request_alarm = None;
|
||||||
|
|
||||||
window->screen = screen;
|
|
||||||
|
|
||||||
meta_window_update_flatpak_id (window);
|
meta_window_update_flatpak_id (window);
|
||||||
meta_window_update_desc (window);
|
meta_window_update_desc (window);
|
||||||
|
|
||||||
window->override_redirect = attrs->override_redirect;
|
window->override_redirect = attrs->override_redirect;
|
||||||
|
|
||||||
/* avoid tons of stack updates */
|
/* avoid tons of stack updates */
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->display->stack);
|
||||||
|
|
||||||
window->rect.x = attrs->x;
|
window->rect.x = attrs->x;
|
||||||
window->rect.y = attrs->y;
|
window->rect.y = attrs->y;
|
||||||
@@ -1088,7 +1086,7 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
/* Apply any window attributes such as initial workspace
|
/* Apply any window attributes such as initial workspace
|
||||||
* based on startup notification
|
* based on startup notification
|
||||||
*/
|
*/
|
||||||
meta_screen_apply_startup_properties (window->screen, window);
|
meta_display_apply_startup_properties (window->display, window);
|
||||||
|
|
||||||
/* Try to get a "launch timestamp" for the window. If the window is
|
/* Try to get a "launch timestamp" for the window. If the window is
|
||||||
* a transient, we'd like to be able to get a last-usage timestamp
|
* a transient, we'd like to be able to get a last-usage timestamp
|
||||||
@@ -1161,8 +1159,8 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
"Window %s is initially on space %d\n",
|
"Window %s is initially on space %d\n",
|
||||||
window->desc, window->initial_workspace);
|
window->desc, window->initial_workspace);
|
||||||
|
|
||||||
workspace = meta_screen_get_workspace_by_index (window->screen,
|
workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager,
|
||||||
window->initial_workspace);
|
window->initial_workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_workspace_state (window, on_all_workspaces, workspace);
|
set_workspace_state (window, on_all_workspaces, workspace);
|
||||||
@@ -1201,7 +1199,7 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
"Putting window %s on active workspace\n",
|
"Putting window %s on active workspace\n",
|
||||||
window->desc);
|
window->desc);
|
||||||
|
|
||||||
set_workspace_state (window, FALSE, window->screen->active_workspace);
|
set_workspace_state (window, FALSE, workspace_manager->active_workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_window_update_struts (window);
|
meta_window_update_struts (window);
|
||||||
@@ -1217,7 +1215,7 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
* means restacking it.
|
* means restacking it.
|
||||||
*/
|
*/
|
||||||
if (!window->override_redirect)
|
if (!window->override_redirect)
|
||||||
meta_stack_add (window->screen->stack,
|
meta_stack_add (window->display->stack,
|
||||||
window);
|
window);
|
||||||
else
|
else
|
||||||
window->layer = META_LAYER_OVERRIDE_REDIRECT; /* otherwise set by MetaStack */
|
window->layer = META_LAYER_OVERRIDE_REDIRECT; /* otherwise set by MetaStack */
|
||||||
@@ -1231,18 +1229,18 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
set_net_wm_state (window);
|
set_net_wm_state (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_compositor_add_window (screen->display->compositor, window);
|
meta_compositor_add_window (window->display->compositor, window);
|
||||||
window->known_to_compositor = TRUE;
|
window->known_to_compositor = TRUE;
|
||||||
|
|
||||||
/* Sync stack changes */
|
/* Sync stack changes */
|
||||||
meta_stack_thaw (window->screen->stack);
|
meta_stack_thaw (window->display->stack);
|
||||||
|
|
||||||
/* Usually the we'll have queued a stack sync anyways, because we've
|
/* Usually the we'll have queued a stack sync anyways, because we've
|
||||||
* added a new frame window or restacked. But if an undecorated
|
* added a new frame window or restacked. But if an undecorated
|
||||||
* window is mapped, already stacked in the right place, then we
|
* window is mapped, already stacked in the right place, then we
|
||||||
* might need to do this explicitly.
|
* might need to do this explicitly.
|
||||||
*/
|
*/
|
||||||
meta_stack_tracker_queue_sync_stack (window->screen->stack_tracker);
|
meta_stack_tracker_queue_sync_stack (window->display->stack_tracker);
|
||||||
|
|
||||||
/* disable show desktop mode unless we're a desktop component */
|
/* disable show desktop mode unless we're a desktop component */
|
||||||
maybe_leave_show_desktop_mode (window);
|
maybe_leave_show_desktop_mode (window);
|
||||||
@@ -1301,6 +1299,7 @@ void
|
|||||||
meta_window_unmanage (MetaWindow *window,
|
meta_window_unmanage (MetaWindow *window,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
|
||||||
meta_verbose ("Unmanaging %s\n", window->desc);
|
meta_verbose ("Unmanaging %s\n", window->desc);
|
||||||
@@ -1350,7 +1349,7 @@ meta_window_unmanage (MetaWindow *window,
|
|||||||
/* Make sure to only show window on all workspaces if requested, to
|
/* Make sure to only show window on all workspaces if requested, to
|
||||||
* not confuse other window managers that may take over
|
* not confuse other window managers that may take over
|
||||||
*/
|
*/
|
||||||
if (window->screen->closing && meta_prefs_get_workspaces_only_on_primary ())
|
if (meta_prefs_get_workspaces_only_on_primary ())
|
||||||
meta_window_on_all_workspaces_changed (window);
|
meta_window_on_all_workspaces_changed (window);
|
||||||
|
|
||||||
if (window->fullscreen)
|
if (window->fullscreen)
|
||||||
@@ -1361,11 +1360,11 @@ meta_window_unmanage (MetaWindow *window,
|
|||||||
* other windows in its group to a higher layer
|
* other windows in its group to a higher layer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->display->stack);
|
||||||
group = meta_window_get_group (window);
|
group = meta_window_get_group (window);
|
||||||
if (group)
|
if (group)
|
||||||
meta_group_update_layers (group);
|
meta_group_update_layers (group);
|
||||||
meta_stack_thaw (window->screen->stack);
|
meta_stack_thaw (window->display->stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_display_remove_pending_pings_for_window (window->display, window);
|
meta_display_remove_pending_pings_for_window (window->display, window);
|
||||||
@@ -1387,7 +1386,7 @@ meta_window_unmanage (MetaWindow *window,
|
|||||||
meta_topic (META_DEBUG_FOCUS,
|
meta_topic (META_DEBUG_FOCUS,
|
||||||
"Focusing default window since we're unmanaging %s\n",
|
"Focusing default window since we're unmanaging %s\n",
|
||||||
window->desc);
|
window->desc);
|
||||||
meta_workspace_focus_default_window (window->screen->active_workspace, NULL, timestamp);
|
meta_workspace_focus_default_window (workspace_manager->active_workspace, NULL, timestamp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1433,7 +1432,7 @@ meta_window_unmanage (MetaWindow *window,
|
|||||||
g_assert (window->workspace == NULL);
|
g_assert (window->workspace == NULL);
|
||||||
|
|
||||||
#ifndef G_DISABLE_CHECKS
|
#ifndef G_DISABLE_CHECKS
|
||||||
tmp = window->screen->workspaces;
|
tmp = workspace_manager->workspaces;
|
||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
{
|
{
|
||||||
MetaWorkspace *workspace = tmp->data;
|
MetaWorkspace *workspace = tmp->data;
|
||||||
@@ -1454,13 +1453,13 @@ meta_window_unmanage (MetaWindow *window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!window->override_redirect)
|
if (!window->override_redirect)
|
||||||
meta_stack_remove (window->screen->stack, window);
|
meta_stack_remove (window->display->stack, window);
|
||||||
|
|
||||||
/* If an undecorated window is being withdrawn, that will change the
|
/* If an undecorated window is being withdrawn, that will change the
|
||||||
* stack as presented to the compositing manager, without actually
|
* stack as presented to the compositing manager, without actually
|
||||||
* changing the stacking order of X windows.
|
* changing the stacking order of X windows.
|
||||||
*/
|
*/
|
||||||
meta_stack_tracker_queue_sync_stack (window->screen->stack_tracker);
|
meta_stack_tracker_queue_sync_stack (window->display->stack_tracker);
|
||||||
|
|
||||||
if (window->display->autoraise_window == window)
|
if (window->display->autoraise_window == window)
|
||||||
meta_display_remove_autoraise_callback (window->display);
|
meta_display_remove_autoraise_callback (window->display);
|
||||||
@@ -1468,7 +1467,7 @@ meta_window_unmanage (MetaWindow *window,
|
|||||||
META_WINDOW_GET_CLASS (window)->unmanage (window);
|
META_WINDOW_GET_CLASS (window)->unmanage (window);
|
||||||
|
|
||||||
meta_prefs_remove_listener (prefs_changed_callback, window);
|
meta_prefs_remove_listener (prefs_changed_callback, window);
|
||||||
meta_screen_queue_check_fullscreen (window->screen);
|
meta_display_queue_check_fullscreen (window->display);
|
||||||
|
|
||||||
g_signal_emit (window, window_signals[UNMANAGED], 0);
|
g_signal_emit (window, window_signals[UNMANAGED], 0);
|
||||||
|
|
||||||
@@ -1545,6 +1544,7 @@ ancestor_is_minimized (MetaWindow *window)
|
|||||||
gboolean
|
gboolean
|
||||||
meta_window_showing_on_its_workspace (MetaWindow *window)
|
meta_window_showing_on_its_workspace (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
gboolean showing;
|
gboolean showing;
|
||||||
gboolean is_desktop_or_dock;
|
gboolean is_desktop_or_dock;
|
||||||
MetaWorkspace* workspace_of_window;
|
MetaWorkspace* workspace_of_window;
|
||||||
@@ -1564,7 +1564,7 @@ meta_window_showing_on_its_workspace (MetaWindow *window)
|
|||||||
&is_desktop_or_dock);
|
&is_desktop_or_dock);
|
||||||
|
|
||||||
if (window->on_all_workspaces)
|
if (window->on_all_workspaces)
|
||||||
workspace_of_window = window->screen->active_workspace;
|
workspace_of_window = workspace_manager->active_workspace;
|
||||||
else if (window->workspace)
|
else if (window->workspace)
|
||||||
workspace_of_window = window->workspace;
|
workspace_of_window = window->workspace;
|
||||||
else /* This only seems to be needed for startup */
|
else /* This only seems to be needed for startup */
|
||||||
@@ -1596,6 +1596,8 @@ meta_window_showing_on_its_workspace (MetaWindow *window)
|
|||||||
gboolean
|
gboolean
|
||||||
meta_window_should_be_showing (MetaWindow *window)
|
meta_window_should_be_showing (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND &&
|
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND &&
|
||||||
!meta_wayland_surface_get_buffer (window->surface))
|
!meta_wayland_surface_get_buffer (window->surface))
|
||||||
@@ -1604,7 +1606,7 @@ meta_window_should_be_showing (MetaWindow *window)
|
|||||||
|
|
||||||
/* Windows should be showing if they're located on the
|
/* Windows should be showing if they're located on the
|
||||||
* active workspace and they're showing on their own workspace. */
|
* active workspace and they're showing on their own workspace. */
|
||||||
return (meta_window_located_on_workspace (window, window->screen->active_workspace) &&
|
return (meta_window_located_on_workspace (window, workspace_manager->active_workspace) &&
|
||||||
meta_window_showing_on_its_workspace (window));
|
meta_window_showing_on_its_workspace (window));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1653,11 +1655,8 @@ stackcmp (gconstpointer a, gconstpointer b)
|
|||||||
MetaWindow *aw = (gpointer) a;
|
MetaWindow *aw = (gpointer) a;
|
||||||
MetaWindow *bw = (gpointer) b;
|
MetaWindow *bw = (gpointer) b;
|
||||||
|
|
||||||
if (aw->screen != bw->screen)
|
return meta_stack_windows_cmp (aw->display->stack,
|
||||||
return 0; /* don't care how they sort with respect to each other */
|
aw, bw);
|
||||||
else
|
|
||||||
return meta_stack_windows_cmp (aw->screen->stack,
|
|
||||||
aw, bw);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -2359,9 +2358,9 @@ meta_window_show (MetaWindow *window)
|
|||||||
|
|
||||||
if (window->hidden)
|
if (window->hidden)
|
||||||
{
|
{
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->display->stack);
|
||||||
window->hidden = FALSE;
|
window->hidden = FALSE;
|
||||||
meta_stack_thaw (window->screen->stack);
|
meta_stack_thaw (window->display->stack);
|
||||||
did_show = TRUE;
|
did_show = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2432,7 +2431,7 @@ meta_window_show (MetaWindow *window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (did_show)
|
if (did_show)
|
||||||
meta_screen_queue_check_fullscreen (window->screen);
|
meta_display_queue_check_fullscreen (window->display);
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
if (did_show && window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
|
if (did_show && window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
|
||||||
@@ -2459,6 +2458,7 @@ meta_window_show (MetaWindow *window)
|
|||||||
static void
|
static void
|
||||||
meta_window_hide (MetaWindow *window)
|
meta_window_hide (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
gboolean did_hide;
|
gboolean did_hide;
|
||||||
|
|
||||||
meta_topic (META_DEBUG_WINDOW_STATE,
|
meta_topic (META_DEBUG_WINDOW_STATE,
|
||||||
@@ -2490,9 +2490,9 @@ meta_window_hide (MetaWindow *window)
|
|||||||
|
|
||||||
if (!window->hidden)
|
if (!window->hidden)
|
||||||
{
|
{
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->display->stack);
|
||||||
window->hidden = TRUE;
|
window->hidden = TRUE;
|
||||||
meta_stack_thaw (window->screen->stack);
|
meta_stack_thaw (window->display->stack);
|
||||||
|
|
||||||
did_hide = TRUE;
|
did_hide = TRUE;
|
||||||
}
|
}
|
||||||
@@ -2529,17 +2529,17 @@ meta_window_hide (MetaWindow *window)
|
|||||||
* We also pass in NULL if we are in the process of hiding all non-desktop
|
* We also pass in NULL if we are in the process of hiding all non-desktop
|
||||||
* windows to avoid unexpected changes to the stacking order.
|
* windows to avoid unexpected changes to the stacking order.
|
||||||
*/
|
*/
|
||||||
if (my_workspace == window->screen->active_workspace &&
|
if (my_workspace == workspace_manager->active_workspace &&
|
||||||
!my_workspace->showing_desktop)
|
!my_workspace->showing_desktop)
|
||||||
not_this_one = window;
|
not_this_one = window;
|
||||||
|
|
||||||
meta_workspace_focus_default_window (window->screen->active_workspace,
|
meta_workspace_focus_default_window (workspace_manager->active_workspace,
|
||||||
not_this_one,
|
not_this_one,
|
||||||
timestamp);
|
timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (did_hide)
|
if (did_hide)
|
||||||
meta_screen_queue_check_fullscreen (window->screen);
|
meta_display_queue_check_fullscreen (window->display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -2688,7 +2688,7 @@ meta_window_maximize_internal (MetaWindow *window,
|
|||||||
set_net_wm_state (window);
|
set_net_wm_state (window);
|
||||||
|
|
||||||
if (window->monitor->in_fullscreen)
|
if (window->monitor->in_fullscreen)
|
||||||
meta_screen_queue_check_fullscreen (window->screen);
|
meta_display_queue_check_fullscreen (window->display);
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (window));
|
g_object_freeze_notify (G_OBJECT (window));
|
||||||
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_MAXIMIZED_HORIZONTALLY]);
|
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_MAXIMIZED_HORIZONTALLY]);
|
||||||
@@ -2810,7 +2810,7 @@ meta_window_is_screen_sized (MetaWindow *window)
|
|||||||
MetaRectangle window_rect;
|
MetaRectangle window_rect;
|
||||||
int screen_width, screen_height;
|
int screen_width, screen_height;
|
||||||
|
|
||||||
meta_screen_get_size (window->screen, &screen_width, &screen_height);
|
meta_display_get_size (window->display, &screen_width, &screen_height);
|
||||||
meta_window_get_frame_rect (window, &window_rect);
|
meta_window_get_frame_rect (window, &window_rect);
|
||||||
|
|
||||||
if (window_rect.x == 0 && window_rect.y == 0 &&
|
if (window_rect.x == 0 && window_rect.y == 0 &&
|
||||||
@@ -2841,7 +2841,7 @@ meta_window_is_monitor_sized (MetaWindow *window)
|
|||||||
MetaRectangle window_rect, monitor_rect;
|
MetaRectangle window_rect, monitor_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &window_rect);
|
meta_window_get_frame_rect (window, &window_rect);
|
||||||
meta_screen_get_monitor_geometry (window->screen, window->monitor->number, &monitor_rect);
|
meta_display_get_monitor_geometry (window->display, window->monitor->number, &monitor_rect);
|
||||||
|
|
||||||
if (meta_rectangle_equal (&window_rect, &monitor_rect))
|
if (meta_rectangle_equal (&window_rect, &monitor_rect))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -2902,7 +2902,7 @@ meta_window_tile (MetaWindow *window)
|
|||||||
directions = META_MAXIMIZE_VERTICAL;
|
directions = META_MAXIMIZE_VERTICAL;
|
||||||
|
|
||||||
meta_window_maximize_internal (window, directions, NULL);
|
meta_window_maximize_internal (window, directions, NULL);
|
||||||
meta_screen_update_tile_preview (window->screen, FALSE);
|
meta_display_update_tile_preview (window->display, FALSE);
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &old_frame_rect);
|
meta_window_get_frame_rect (window, &old_frame_rect);
|
||||||
meta_window_get_buffer_rect (window, &old_buffer_rect);
|
meta_window_get_buffer_rect (window, &old_buffer_rect);
|
||||||
@@ -2938,7 +2938,7 @@ meta_window_can_tile_side_by_side (MetaWindow *window)
|
|||||||
if (!meta_window_can_tile_maximized (window))
|
if (!meta_window_can_tile_maximized (window))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
monitor = meta_screen_get_current_monitor (window->screen);
|
monitor = meta_display_get_current_monitor (window->display);
|
||||||
meta_window_get_work_area_for_monitor (window, monitor, &tile_area);
|
meta_window_get_work_area_for_monitor (window, monitor, &tile_area);
|
||||||
|
|
||||||
/* Do not allow tiling in portrait orientation */
|
/* Do not allow tiling in portrait orientation */
|
||||||
@@ -2968,11 +2968,8 @@ unmaximize_window_before_freeing (MetaWindow *window)
|
|||||||
window->rect = window->saved_rect;
|
window->rect = window->saved_rect;
|
||||||
set_net_wm_state (window);
|
set_net_wm_state (window);
|
||||||
}
|
}
|
||||||
else if (window->screen->closing /* See bug #358042 */
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
&& !meta_is_wayland_compositor ()
|
else if (!meta_is_wayland_compositor ())
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
/* Do NOT update net_wm_state: this screen is closing,
|
/* Do NOT update net_wm_state: this screen is closing,
|
||||||
* it likely will be managed by another window manager
|
* it likely will be managed by another window manager
|
||||||
@@ -2987,6 +2984,7 @@ unmaximize_window_before_freeing (MetaWindow *window)
|
|||||||
window->saved_rect.width,
|
window->saved_rect.width,
|
||||||
window->saved_rect.height);
|
window->saved_rect.height);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -3109,7 +3107,7 @@ meta_window_unmaximize (MetaWindow *window,
|
|||||||
meta_window_recalc_features (window);
|
meta_window_recalc_features (window);
|
||||||
set_net_wm_state (window);
|
set_net_wm_state (window);
|
||||||
if (!window->monitor->in_fullscreen)
|
if (!window->monitor->in_fullscreen)
|
||||||
meta_screen_queue_check_fullscreen (window->screen);
|
meta_display_queue_check_fullscreen (window->display);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (window));
|
g_object_freeze_notify (G_OBJECT (window));
|
||||||
@@ -3173,16 +3171,16 @@ meta_window_make_fullscreen_internal (MetaWindow *window)
|
|||||||
|
|
||||||
window->fullscreen = TRUE;
|
window->fullscreen = TRUE;
|
||||||
|
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->display->stack);
|
||||||
|
|
||||||
meta_window_raise (window);
|
meta_window_raise (window);
|
||||||
meta_stack_thaw (window->screen->stack);
|
meta_stack_thaw (window->display->stack);
|
||||||
|
|
||||||
meta_window_recalc_features (window);
|
meta_window_recalc_features (window);
|
||||||
set_net_wm_state (window);
|
set_net_wm_state (window);
|
||||||
|
|
||||||
/* For the auto-minimize feature, if we fail to get focus */
|
/* For the auto-minimize feature, if we fail to get focus */
|
||||||
meta_screen_queue_check_fullscreen (window->screen);
|
meta_display_queue_check_fullscreen (window->display);
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_FULLSCREEN]);
|
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_FULLSCREEN]);
|
||||||
}
|
}
|
||||||
@@ -3256,7 +3254,7 @@ meta_window_unmake_fullscreen (MetaWindow *window)
|
|||||||
NorthWestGravity,
|
NorthWestGravity,
|
||||||
target_rect);
|
target_rect);
|
||||||
|
|
||||||
meta_screen_queue_check_fullscreen (window->screen);
|
meta_display_queue_check_fullscreen (window->display);
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_FULLSCREEN]);
|
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_FULLSCREEN]);
|
||||||
}
|
}
|
||||||
@@ -3374,6 +3372,7 @@ meta_window_activate_full (MetaWindow *window,
|
|||||||
MetaClientType source_indication,
|
MetaClientType source_indication,
|
||||||
MetaWorkspace *workspace)
|
MetaWorkspace *workspace)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
gboolean allow_workspace_switch;
|
gboolean allow_workspace_switch;
|
||||||
meta_topic (META_DEBUG_FOCUS,
|
meta_topic (META_DEBUG_FOCUS,
|
||||||
"_NET_ACTIVE_WINDOW message sent for %s at time %u "
|
"_NET_ACTIVE_WINDOW message sent for %s at time %u "
|
||||||
@@ -3402,7 +3401,7 @@ meta_window_activate_full (MetaWindow *window,
|
|||||||
|
|
||||||
/* Get window on current or given workspace */
|
/* Get window on current or given workspace */
|
||||||
if (workspace == NULL)
|
if (workspace == NULL)
|
||||||
workspace = window->screen->active_workspace;
|
workspace = workspace_manager->active_workspace;
|
||||||
|
|
||||||
/* For non-transient windows, we just set up a pulsing indicator,
|
/* For non-transient windows, we just set up a pulsing indicator,
|
||||||
rather than move windows or workspaces.
|
rather than move windows or workspaces.
|
||||||
@@ -3600,6 +3599,7 @@ void
|
|||||||
meta_window_update_monitor (MetaWindow *window,
|
meta_window_update_monitor (MetaWindow *window,
|
||||||
gboolean user_op)
|
gboolean user_op)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
const MetaLogicalMonitor *old;
|
const MetaLogicalMonitor *old;
|
||||||
|
|
||||||
old = window->monitor;
|
old = window->monitor;
|
||||||
@@ -3619,8 +3619,8 @@ meta_window_update_monitor (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
if (meta_prefs_get_workspaces_only_on_primary () && user_op &&
|
if (meta_prefs_get_workspaces_only_on_primary () && user_op &&
|
||||||
meta_window_is_on_primary_monitor (window) &&
|
meta_window_is_on_primary_monitor (window) &&
|
||||||
window->screen->active_workspace != window->workspace)
|
workspace_manager->active_workspace != window->workspace)
|
||||||
meta_window_change_workspace (window, window->screen->active_workspace);
|
meta_window_change_workspace (window, workspace_manager->active_workspace);
|
||||||
|
|
||||||
meta_window_main_monitor_changed (window, old);
|
meta_window_main_monitor_changed (window, old);
|
||||||
|
|
||||||
@@ -3655,6 +3655,7 @@ meta_window_move_resize_internal (MetaWindow *window,
|
|||||||
* to the client.
|
* to the client.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
gboolean did_placement;
|
gboolean did_placement;
|
||||||
guint old_output_winsys_id;
|
guint old_output_winsys_id;
|
||||||
MetaRectangle unconstrained_rect;
|
MetaRectangle unconstrained_rect;
|
||||||
@@ -3776,8 +3777,8 @@ meta_window_move_resize_internal (MetaWindow *window,
|
|||||||
|
|
||||||
meta_window_foreach_transient (window, maybe_move_attached_dialog, NULL);
|
meta_window_foreach_transient (window, maybe_move_attached_dialog, NULL);
|
||||||
|
|
||||||
meta_stack_update_window_tile_matches (window->screen->stack,
|
meta_stack_update_window_tile_matches (window->display->stack,
|
||||||
window->screen->active_workspace);
|
workspace_manager->active_workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3906,7 +3907,7 @@ meta_window_move_to_monitor (MetaWindow *window,
|
|||||||
window->preferred_output_winsys_id = window->monitor->winsys_id;
|
window->preferred_output_winsys_id = window->monitor->winsys_id;
|
||||||
|
|
||||||
if (window->fullscreen || window->override_redirect)
|
if (window->fullscreen || window->override_redirect)
|
||||||
meta_screen_queue_check_fullscreen (window->screen);
|
meta_display_queue_check_fullscreen (window->display);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -4319,6 +4320,7 @@ void
|
|||||||
meta_window_focus (MetaWindow *window,
|
meta_window_focus (MetaWindow *window,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
MetaWindow *modal_transient;
|
MetaWindow *modal_transient;
|
||||||
|
|
||||||
g_return_if_fail (!window->override_redirect);
|
g_return_if_fail (!window->override_redirect);
|
||||||
@@ -4345,8 +4347,8 @@ meta_window_focus (MetaWindow *window,
|
|||||||
meta_topic (META_DEBUG_FOCUS,
|
meta_topic (META_DEBUG_FOCUS,
|
||||||
"%s has %s as a modal transient, so focusing it instead.\n",
|
"%s has %s as a modal transient, so focusing it instead.\n",
|
||||||
window->desc, modal_transient->desc);
|
window->desc, modal_transient->desc);
|
||||||
if (!meta_window_located_on_workspace (modal_transient, window->screen->active_workspace))
|
if (!meta_window_located_on_workspace (modal_transient, workspace_manager->active_workspace))
|
||||||
meta_window_change_workspace (modal_transient, window->screen->active_workspace);
|
meta_window_change_workspace (modal_transient, workspace_manager->active_workspace);
|
||||||
window = modal_transient;
|
window = modal_transient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4396,6 +4398,8 @@ set_workspace_state (MetaWindow *window,
|
|||||||
gboolean on_all_workspaces,
|
gboolean on_all_workspaces,
|
||||||
MetaWorkspace *workspace)
|
MetaWorkspace *workspace)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
/* If we're on all workspaces, then our new workspace must be NULL. */
|
/* If we're on all workspaces, then our new workspace must be NULL. */
|
||||||
if (on_all_workspaces)
|
if (on_all_workspaces)
|
||||||
g_assert (workspace == NULL);
|
g_assert (workspace == NULL);
|
||||||
@@ -4417,7 +4421,7 @@ set_workspace_state (MetaWindow *window,
|
|||||||
else if (window->on_all_workspaces)
|
else if (window->on_all_workspaces)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
for (l = window->screen->workspaces; l != NULL; l = l->next)
|
for (l = workspace_manager->workspaces; l != NULL; l = l->next)
|
||||||
{
|
{
|
||||||
MetaWorkspace *ws = l->data;
|
MetaWorkspace *ws = l->data;
|
||||||
meta_workspace_remove_window (ws, window);
|
meta_workspace_remove_window (ws, window);
|
||||||
@@ -4432,7 +4436,7 @@ set_workspace_state (MetaWindow *window,
|
|||||||
else if (window->on_all_workspaces)
|
else if (window->on_all_workspaces)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
for (l = window->screen->workspaces; l != NULL; l = l->next)
|
for (l = workspace_manager->workspaces; l != NULL; l = l->next)
|
||||||
{
|
{
|
||||||
MetaWorkspace *ws = l->data;
|
MetaWorkspace *ws = l->data;
|
||||||
meta_workspace_add_window (ws, window);
|
meta_workspace_add_window (ws, window);
|
||||||
@@ -4465,6 +4469,7 @@ should_be_on_all_workspaces (MetaWindow *window)
|
|||||||
void
|
void
|
||||||
meta_window_on_all_workspaces_changed (MetaWindow *window)
|
meta_window_on_all_workspaces_changed (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
gboolean on_all_workspaces = should_be_on_all_workspaces (window);
|
gboolean on_all_workspaces = should_be_on_all_workspaces (window);
|
||||||
|
|
||||||
if (window->on_all_workspaces == on_all_workspaces)
|
if (window->on_all_workspaces == on_all_workspaces)
|
||||||
@@ -4480,7 +4485,7 @@ meta_window_on_all_workspaces_changed (MetaWindow *window)
|
|||||||
{
|
{
|
||||||
/* We're coming out of the sticky state. Put the window on
|
/* We're coming out of the sticky state. Put the window on
|
||||||
* the currently active workspace. */
|
* the currently active workspace. */
|
||||||
workspace = window->screen->active_workspace;
|
workspace = workspace_manager->active_workspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_workspace_state (window, on_all_workspaces, workspace);
|
set_workspace_state (window, on_all_workspaces, workspace);
|
||||||
@@ -4656,13 +4661,13 @@ meta_window_raise (MetaWindow *window)
|
|||||||
* constraints in stack.c then magically take care of raising all
|
* constraints in stack.c then magically take care of raising all
|
||||||
* the child windows appropriately.
|
* the child windows appropriately.
|
||||||
*/
|
*/
|
||||||
if (window->screen->stack == ancestor->screen->stack)
|
if (window->display->stack == ancestor->display->stack)
|
||||||
meta_stack_raise (window->screen->stack, ancestor);
|
meta_stack_raise (window->display->stack, ancestor);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
meta_warning (
|
meta_warning (
|
||||||
"Either stacks aren't per screen or some window has a weird "
|
"Either stacks aren't per screen or some window has a weird "
|
||||||
"transient_for hint; window->screen->stack != "
|
"transient_for hint; window->display->stack != "
|
||||||
"ancestor->screen->stack. window = %s, ancestor = %s.\n",
|
"ancestor->screen->stack. window = %s, ancestor = %s.\n",
|
||||||
window->desc, ancestor->desc);
|
window->desc, ancestor->desc);
|
||||||
/* We could raise the window here, but don't want to do that twice and
|
/* We could raise the window here, but don't want to do that twice and
|
||||||
@@ -4676,7 +4681,7 @@ meta_window_raise (MetaWindow *window)
|
|||||||
* correct child. See bug 307875.
|
* correct child. See bug 307875.
|
||||||
*/
|
*/
|
||||||
if (window != ancestor)
|
if (window != ancestor)
|
||||||
meta_stack_raise (window->screen->stack, window);
|
meta_stack_raise (window->display->stack, window);
|
||||||
|
|
||||||
g_signal_emit (window, window_signals[RAISED], 0);
|
g_signal_emit (window, window_signals[RAISED], 0);
|
||||||
}
|
}
|
||||||
@@ -4689,7 +4694,7 @@ meta_window_lower (MetaWindow *window)
|
|||||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||||
"Lowering window %s\n", window->desc);
|
"Lowering window %s\n", window->desc);
|
||||||
|
|
||||||
meta_stack_lower (window->screen->stack, window);
|
meta_stack_lower (window->display->stack, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -4701,8 +4706,9 @@ meta_window_change_workspace_by_index (MetaWindow *window,
|
|||||||
gint space_index,
|
gint space_index,
|
||||||
gboolean append)
|
gboolean append)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager;
|
||||||
MetaWorkspace *workspace;
|
MetaWorkspace *workspace;
|
||||||
MetaScreen *screen;
|
MetaDisplay *display;
|
||||||
|
|
||||||
g_return_if_fail (!window->override_redirect);
|
g_return_if_fail (!window->override_redirect);
|
||||||
|
|
||||||
@@ -4712,13 +4718,14 @@ meta_window_change_workspace_by_index (MetaWindow *window,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
screen = window->screen;
|
display = window->display;
|
||||||
|
workspace_manager = display->workspace_manager;
|
||||||
|
|
||||||
workspace =
|
workspace =
|
||||||
meta_screen_get_workspace_by_index (screen, space_index);
|
meta_workspace_manager_get_workspace_by_index (workspace_manager, space_index);
|
||||||
|
|
||||||
if (!workspace && append)
|
if (!workspace && append)
|
||||||
workspace = meta_screen_append_new_workspace (screen, FALSE, CurrentTime);
|
workspace = meta_workspace_manager_append_new_workspace (workspace_manager, FALSE, META_CURRENT_TIME);
|
||||||
|
|
||||||
if (workspace)
|
if (workspace)
|
||||||
meta_window_change_workspace (window, workspace);
|
meta_window_change_workspace (window, workspace);
|
||||||
@@ -4818,6 +4825,8 @@ void
|
|||||||
meta_window_set_focused_internal (MetaWindow *window,
|
meta_window_set_focused_internal (MetaWindow *window,
|
||||||
gboolean focused)
|
gboolean focused)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
if (focused)
|
if (focused)
|
||||||
{
|
{
|
||||||
window->has_focus = TRUE;
|
window->has_focus = TRUE;
|
||||||
@@ -4832,22 +4841,22 @@ meta_window_set_focused_internal (MetaWindow *window,
|
|||||||
* list only if the window is actually on the active
|
* list only if the window is actually on the active
|
||||||
* workspace.
|
* workspace.
|
||||||
*/
|
*/
|
||||||
if (window->screen->active_workspace &&
|
if (workspace_manager->active_workspace &&
|
||||||
meta_window_located_on_workspace (window,
|
meta_window_located_on_workspace (window,
|
||||||
window->screen->active_workspace))
|
workspace_manager->active_workspace))
|
||||||
{
|
{
|
||||||
GList* link;
|
GList* link;
|
||||||
link = g_list_find (window->screen->active_workspace->mru_list,
|
link = g_list_find (workspace_manager->active_workspace->mru_list,
|
||||||
window);
|
window);
|
||||||
g_assert (link);
|
g_assert (link);
|
||||||
|
|
||||||
window->screen->active_workspace->mru_list =
|
workspace_manager->active_workspace->mru_list =
|
||||||
g_list_remove_link (window->screen->active_workspace->mru_list,
|
g_list_remove_link (workspace_manager->active_workspace->mru_list,
|
||||||
link);
|
link);
|
||||||
g_list_free (link);
|
g_list_free (link);
|
||||||
|
|
||||||
window->screen->active_workspace->mru_list =
|
workspace_manager->active_workspace->mru_list =
|
||||||
g_list_prepend (window->screen->active_workspace->mru_list,
|
g_list_prepend (workspace_manager->active_workspace->mru_list,
|
||||||
window);
|
window);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5090,8 +5099,10 @@ idle_update_icon (gpointer data)
|
|||||||
GList*
|
GList*
|
||||||
meta_window_get_workspaces (MetaWindow *window)
|
meta_window_get_workspaces (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
if (window->on_all_workspaces)
|
if (window->on_all_workspaces)
|
||||||
return window->screen->workspaces;
|
return workspace_manager->workspaces;
|
||||||
else if (window->workspace != NULL)
|
else if (window->workspace != NULL)
|
||||||
return window->workspace->list_containing_self;
|
return window->workspace->list_containing_self;
|
||||||
else if (window->constructing)
|
else if (window->constructing)
|
||||||
@@ -5321,13 +5332,17 @@ meta_window_recalc_features (MetaWindow *window)
|
|||||||
if (!window->has_resize_func)
|
if (!window->has_resize_func)
|
||||||
{
|
{
|
||||||
window->has_maximize_func = FALSE;
|
window->has_maximize_func = FALSE;
|
||||||
|
MetaRectangle display_rect;
|
||||||
|
|
||||||
|
meta_display_get_size (window->display, &display_rect.width,
|
||||||
|
&display_rect.height);
|
||||||
|
|
||||||
/* don't allow fullscreen if we can't resize, unless the size
|
/* don't allow fullscreen if we can't resize, unless the size
|
||||||
* is entire screen size (kind of broken, because we
|
* is entire screen size (kind of broken, because we
|
||||||
* actually fullscreen to monitor size not screen size)
|
* actually fullscreen to monitor size not screen size)
|
||||||
*/
|
*/
|
||||||
if (window->size_hints.min_width == window->screen->rect.width &&
|
if (window->size_hints.min_width == display_rect.width &&
|
||||||
window->size_hints.min_height == window->screen->rect.height)
|
window->size_hints.min_height == display_rect.height)
|
||||||
; /* leave fullscreen available */
|
; /* leave fullscreen available */
|
||||||
else
|
else
|
||||||
window->has_fullscreen_func = FALSE;
|
window->has_fullscreen_func = FALSE;
|
||||||
@@ -5444,6 +5459,7 @@ meta_window_show_menu_for_rect (MetaWindow *window,
|
|||||||
void
|
void
|
||||||
meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
MetaRectangle frame_rect;
|
MetaRectangle frame_rect;
|
||||||
GList *onscreen_region;
|
GList *onscreen_region;
|
||||||
int horiz_amount, vert_amount;
|
int horiz_amount, vert_amount;
|
||||||
@@ -5456,7 +5472,7 @@ meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
|||||||
|
|
||||||
/* Get the basic info we need */
|
/* Get the basic info we need */
|
||||||
meta_window_get_frame_rect (window, &frame_rect);
|
meta_window_get_frame_rect (window, &frame_rect);
|
||||||
onscreen_region = window->screen->active_workspace->screen_region;
|
onscreen_region = workspace_manager->active_workspace->screen_region;
|
||||||
|
|
||||||
/* Extend the region (just in case the window is too big to fit on the
|
/* Extend the region (just in case the window is too big to fit on the
|
||||||
* screen), then shove the window on screen, then return the region to
|
* screen), then shove the window on screen, then return the region to
|
||||||
@@ -5484,6 +5500,7 @@ meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
|||||||
gboolean
|
gboolean
|
||||||
meta_window_titlebar_is_onscreen (MetaWindow *window)
|
meta_window_titlebar_is_onscreen (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
MetaRectangle titlebar_rect, frame_rect;
|
MetaRectangle titlebar_rect, frame_rect;
|
||||||
GList *onscreen_region;
|
GList *onscreen_region;
|
||||||
gboolean is_onscreen;
|
gboolean is_onscreen;
|
||||||
@@ -5508,7 +5525,7 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
|
|||||||
* them overlaps with the titlebar sufficiently to consider it onscreen.
|
* them overlaps with the titlebar sufficiently to consider it onscreen.
|
||||||
*/
|
*/
|
||||||
is_onscreen = FALSE;
|
is_onscreen = FALSE;
|
||||||
onscreen_region = window->screen->active_workspace->screen_region;
|
onscreen_region = workspace_manager->active_workspace->screen_region;
|
||||||
while (onscreen_region)
|
while (onscreen_region)
|
||||||
{
|
{
|
||||||
MetaRectangle *spanning_rect = onscreen_region->data;
|
MetaRectangle *spanning_rect = onscreen_region->data;
|
||||||
@@ -5814,8 +5831,8 @@ update_move (MetaWindow *window,
|
|||||||
* trigger it unwittingly, e.g. when shaking loose the window or moving
|
* trigger it unwittingly, e.g. when shaking loose the window or moving
|
||||||
* it to another monitor.
|
* it to another monitor.
|
||||||
*/
|
*/
|
||||||
meta_screen_update_tile_preview (window->screen,
|
meta_display_update_tile_preview (window->display,
|
||||||
window->tile_mode != META_TILE_NONE);
|
window->tile_mode != META_TILE_NONE);
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &old);
|
meta_window_get_frame_rect (window, &old);
|
||||||
|
|
||||||
@@ -6219,9 +6236,13 @@ meta_window_get_work_area_all_monitors (MetaWindow *window,
|
|||||||
MetaRectangle *area)
|
MetaRectangle *area)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
MetaRectangle display_rect;
|
||||||
|
|
||||||
/* Initialize to the whole screen */
|
meta_display_get_size (window->display, &display_rect.width,
|
||||||
*area = window->screen->rect;
|
&display_rect.height);
|
||||||
|
|
||||||
|
/* Initialize to the whole display */
|
||||||
|
*area = display_rect;
|
||||||
|
|
||||||
tmp = meta_window_get_workspaces (window);
|
tmp = meta_window_get_workspaces (window);
|
||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
@@ -6436,10 +6457,12 @@ warp_grab_pointer (MetaWindow *window,
|
|||||||
int *x,
|
int *x,
|
||||||
int *y)
|
int *y)
|
||||||
{
|
{
|
||||||
MetaRectangle rect;
|
MetaRectangle display_rect, rect;
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
|
|
||||||
display = window->display;
|
display = window->display;
|
||||||
|
meta_display_get_size (display, &display_rect.width,
|
||||||
|
&display_rect.height);
|
||||||
|
|
||||||
/* We may not have done begin_grab_op yet, i.e. may not be in a grab
|
/* We may not have done begin_grab_op yet, i.e. may not be in a grab
|
||||||
*/
|
*/
|
||||||
@@ -6464,10 +6487,10 @@ warp_grab_pointer (MetaWindow *window,
|
|||||||
*y += rect.y;
|
*y += rect.y;
|
||||||
|
|
||||||
/* Avoid weird bouncing at the screen edge; see bug 154706 */
|
/* Avoid weird bouncing at the screen edge; see bug 154706 */
|
||||||
*x = CLAMP (*x, 0, window->screen->rect.width-1);
|
*x = CLAMP (*x, 0, display_rect.width-1);
|
||||||
*y = CLAMP (*y, 0, window->screen->rect.height-1);
|
*y = CLAMP (*y, 0, display_rect.height-1);
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (display->x11_display);
|
||||||
|
|
||||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||||
"Warping pointer to %d,%d with window at %d,%d\n",
|
"Warping pointer to %d,%d with window at %d,%d\n",
|
||||||
@@ -6489,7 +6512,7 @@ warp_grab_pointer (MetaWindow *window,
|
|||||||
meta_backend_warp_pointer (backend, *x, *y);
|
meta_backend_warp_pointer (backend, *x, *y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (meta_error_trap_pop_with_return (display) != Success)
|
if (meta_x11_error_trap_pop_with_return (display->x11_display) != Success)
|
||||||
{
|
{
|
||||||
meta_verbose ("Failed to warp pointer for window %s\n",
|
meta_verbose ("Failed to warp pointer for window %s\n",
|
||||||
window->desc);
|
window->desc);
|
||||||
@@ -6511,7 +6534,6 @@ meta_window_begin_grab_op (MetaWindow *window,
|
|||||||
op, &x, &y);
|
op, &x, &y);
|
||||||
|
|
||||||
meta_display_begin_grab_op (window->display,
|
meta_display_begin_grab_op (window->display,
|
||||||
window->screen,
|
|
||||||
window,
|
window,
|
||||||
op,
|
op,
|
||||||
FALSE,
|
FALSE,
|
||||||
@@ -6551,13 +6573,13 @@ meta_window_update_layer (MetaWindow *window)
|
|||||||
{
|
{
|
||||||
MetaGroup *group;
|
MetaGroup *group;
|
||||||
|
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->display->stack);
|
||||||
group = meta_window_get_group (window);
|
group = meta_window_get_group (window);
|
||||||
if (group)
|
if (group)
|
||||||
meta_group_update_layers (group);
|
meta_group_update_layers (group);
|
||||||
else
|
else
|
||||||
meta_stack_update_layer (window->screen->stack, window);
|
meta_stack_update_layer (window->display->stack, window);
|
||||||
meta_stack_thaw (window->screen->stack);
|
meta_stack_thaw (window->display->stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ensure_mru_position_after ensures that window appears after
|
/* ensure_mru_position_after ensures that window appears after
|
||||||
@@ -6575,11 +6597,12 @@ ensure_mru_position_after (MetaWindow *window,
|
|||||||
* map.
|
* map.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
GList* active_mru_list;
|
GList* active_mru_list;
|
||||||
GList* window_position;
|
GList* window_position;
|
||||||
GList* after_this_one_position;
|
GList* after_this_one_position;
|
||||||
|
|
||||||
active_mru_list = window->screen->active_workspace->mru_list;
|
active_mru_list = workspace_manager->active_workspace->mru_list;
|
||||||
window_position = g_list_find (active_mru_list, window);
|
window_position = g_list_find (active_mru_list, window);
|
||||||
after_this_one_position = g_list_find (active_mru_list, after_this_one);
|
after_this_one_position = g_list_find (active_mru_list, after_this_one);
|
||||||
|
|
||||||
@@ -6592,12 +6615,12 @@ ensure_mru_position_after (MetaWindow *window,
|
|||||||
|
|
||||||
if (g_list_length (window_position) > g_list_length (after_this_one_position))
|
if (g_list_length (window_position) > g_list_length (after_this_one_position))
|
||||||
{
|
{
|
||||||
window->screen->active_workspace->mru_list =
|
workspace_manager->active_workspace->mru_list =
|
||||||
g_list_delete_link (window->screen->active_workspace->mru_list,
|
g_list_delete_link (workspace_manager->active_workspace->mru_list,
|
||||||
window_position);
|
window_position);
|
||||||
|
|
||||||
window->screen->active_workspace->mru_list =
|
workspace_manager->active_workspace->mru_list =
|
||||||
g_list_insert_before (window->screen->active_workspace->mru_list,
|
g_list_insert_before (workspace_manager->active_workspace->mru_list,
|
||||||
after_this_one_position->next,
|
after_this_one_position->next,
|
||||||
window);
|
window);
|
||||||
}
|
}
|
||||||
@@ -6715,12 +6738,13 @@ meta_window_get_stable_sequence (MetaWindow *window)
|
|||||||
void
|
void
|
||||||
meta_window_set_demands_attention (MetaWindow *window)
|
meta_window_set_demands_attention (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
MetaRectangle candidate_rect, other_rect;
|
MetaRectangle candidate_rect, other_rect;
|
||||||
GList *stack = window->screen->stack->sorted;
|
GList *stack = window->display->stack->sorted;
|
||||||
MetaWindow *other_window;
|
MetaWindow *other_window;
|
||||||
gboolean obscured = FALSE;
|
gboolean obscured = FALSE;
|
||||||
|
|
||||||
MetaWorkspace *workspace = window->screen->active_workspace;
|
MetaWorkspace *workspace = workspace_manager->active_workspace;
|
||||||
|
|
||||||
if (window->wm_state_demands_attention)
|
if (window->wm_state_demands_attention)
|
||||||
return;
|
return;
|
||||||
@@ -6864,20 +6888,6 @@ meta_window_is_skip_taskbar (MetaWindow *window)
|
|||||||
return window->skip_taskbar;
|
return window->skip_taskbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* meta_window_get_screen:
|
|
||||||
* @window: a #MetaWindow
|
|
||||||
*
|
|
||||||
* Gets the #MetaScreen that the window is on.
|
|
||||||
*
|
|
||||||
* Return value: (transfer none): the #MetaScreen for the window
|
|
||||||
*/
|
|
||||||
MetaScreen *
|
|
||||||
meta_window_get_screen (MetaWindow *window)
|
|
||||||
{
|
|
||||||
return window->screen;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_window_get_display:
|
* meta_window_get_display:
|
||||||
* @window: A #MetaWindow
|
* @window: A #MetaWindow
|
||||||
@@ -6920,8 +6930,10 @@ meta_window_get_window_type (MetaWindow *window)
|
|||||||
MetaWorkspace *
|
MetaWorkspace *
|
||||||
meta_window_get_workspace (MetaWindow *window)
|
meta_window_get_workspace (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
if (window->on_all_workspaces)
|
if (window->on_all_workspaces)
|
||||||
return window->screen->active_workspace;
|
return workspace_manager->active_workspace;
|
||||||
else
|
else
|
||||||
return window->workspace;
|
return window->workspace;
|
||||||
}
|
}
|
||||||
@@ -7148,8 +7160,8 @@ meta_window_get_transient_for (MetaWindow *window)
|
|||||||
if (window->transient_for)
|
if (window->transient_for)
|
||||||
return window->transient_for;
|
return window->transient_for;
|
||||||
else if (window->xtransient_for)
|
else if (window->xtransient_for)
|
||||||
return meta_display_lookup_x_window (window->display,
|
return meta_x11_display_lookup_x_window (window->display->x11_display,
|
||||||
window->xtransient_for);
|
window->xtransient_for);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -7395,7 +7407,7 @@ meta_window_compute_tile_match (MetaWindow *window)
|
|||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
stack = window->screen->stack;
|
stack = window->display->stack;
|
||||||
|
|
||||||
for (match = meta_stack_get_top (stack);
|
for (match = meta_stack_get_top (stack);
|
||||||
match;
|
match;
|
||||||
@@ -7414,7 +7426,7 @@ meta_window_compute_tile_match (MetaWindow *window)
|
|||||||
MetaWindow *above, *bottommost, *topmost;
|
MetaWindow *above, *bottommost, *topmost;
|
||||||
MetaRectangle above_rect, bottommost_rect, topmost_rect;
|
MetaRectangle above_rect, bottommost_rect, topmost_rect;
|
||||||
|
|
||||||
if (meta_stack_windows_cmp (window->screen->stack, match, window) > 0)
|
if (meta_stack_windows_cmp (window->display->stack, match, window) > 0)
|
||||||
{
|
{
|
||||||
topmost = match;
|
topmost = match;
|
||||||
bottommost = window;
|
bottommost = window;
|
||||||
@@ -7577,7 +7589,7 @@ meta_window_set_transient_for (MetaWindow *window,
|
|||||||
|
|
||||||
/* update stacking constraints */
|
/* update stacking constraints */
|
||||||
if (!window->override_redirect)
|
if (!window->override_redirect)
|
||||||
meta_stack_update_transient (window->screen->stack, window);
|
meta_stack_update_transient (window->display->stack, window);
|
||||||
|
|
||||||
/* possibly change its group. We treat being a window's transient as
|
/* possibly change its group. We treat being a window's transient as
|
||||||
* equivalent to making it your group leader, to work around shortcomings
|
* equivalent to making it your group leader, to work around shortcomings
|
||||||
@@ -7663,9 +7675,8 @@ mouse_mode_focus (MetaWindow *window,
|
|||||||
"Unsetting focus from %s due to mouse entering "
|
"Unsetting focus from %s due to mouse entering "
|
||||||
"the DESKTOP window\n",
|
"the DESKTOP window\n",
|
||||||
display->focus_window->desc);
|
display->focus_window->desc);
|
||||||
meta_display_focus_the_no_focus_window (display,
|
meta_x11_display_focus_the_no_focus_window (display->x11_display,
|
||||||
window->screen,
|
timestamp);
|
||||||
timestamp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7688,25 +7699,24 @@ window_has_pointer_wayland (MetaWindow *window)
|
|||||||
static gboolean
|
static gboolean
|
||||||
window_has_pointer_x11 (MetaWindow *window)
|
window_has_pointer_x11 (MetaWindow *window)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = window->display;
|
MetaX11Display *x11_display = window->display->x11_display;
|
||||||
MetaScreen *screen = window->screen;
|
|
||||||
Window root, child;
|
Window root, child;
|
||||||
double root_x, root_y, x, y;
|
double root_x, root_y, x, y;
|
||||||
XIButtonState buttons;
|
XIButtonState buttons;
|
||||||
XIModifierState mods;
|
XIModifierState mods;
|
||||||
XIGroupState group;
|
XIGroupState group;
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
XIQueryPointer (display->xdisplay,
|
XIQueryPointer (x11_display->xdisplay,
|
||||||
META_VIRTUAL_CORE_POINTER_ID,
|
META_VIRTUAL_CORE_POINTER_ID,
|
||||||
screen->xroot,
|
x11_display->xroot,
|
||||||
&root, &child,
|
&root, &child,
|
||||||
&root_x, &root_y, &x, &y,
|
&root_x, &root_y, &x, &y,
|
||||||
&buttons, &mods, &group);
|
&buttons, &mods, &group);
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (x11_display);
|
||||||
free (buttons.mask);
|
free (buttons.mask);
|
||||||
|
|
||||||
return meta_display_lookup_x_window (display, child) == window;
|
return meta_x11_display_lookup_x_window (x11_display, child) == window;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@@ -7942,7 +7952,6 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
|||||||
|
|
||||||
if (op != META_GRAB_OP_WINDOW_BASE)
|
if (op != META_GRAB_OP_WINDOW_BASE)
|
||||||
meta_display_begin_grab_op (display,
|
meta_display_begin_grab_op (display,
|
||||||
window->screen,
|
|
||||||
window,
|
window,
|
||||||
op,
|
op,
|
||||||
TRUE,
|
TRUE,
|
||||||
@@ -7966,7 +7975,6 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
|||||||
if (window->has_move_func)
|
if (window->has_move_func)
|
||||||
{
|
{
|
||||||
meta_display_begin_grab_op (display,
|
meta_display_begin_grab_op (display,
|
||||||
window->screen,
|
|
||||||
window,
|
window,
|
||||||
META_GRAB_OP_MOVING,
|
META_GRAB_OP_MOVING,
|
||||||
TRUE,
|
TRUE,
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
struct _MetaWorkspace
|
struct _MetaWorkspace
|
||||||
{
|
{
|
||||||
GObject parent_instance;
|
GObject parent_instance;
|
||||||
MetaScreen *screen;
|
MetaDisplay *display;
|
||||||
|
MetaWorkspaceManager *manager;
|
||||||
|
|
||||||
GList *windows;
|
GList *windows;
|
||||||
|
|
||||||
@@ -72,7 +73,7 @@ struct _MetaWorkspaceClass
|
|||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
MetaWorkspace* meta_workspace_new (MetaScreen *screen);
|
MetaWorkspace* meta_workspace_new (MetaWorkspaceManager *workspace_manager);
|
||||||
void meta_workspace_remove (MetaWorkspace *workspace);
|
void meta_workspace_remove (MetaWorkspace *workspace);
|
||||||
void meta_workspace_add_window (MetaWorkspace *workspace,
|
void meta_workspace_add_window (MetaWorkspace *workspace,
|
||||||
MetaWindow *window);
|
MetaWindow *window);
|
||||||
|
|||||||
@@ -34,11 +34,12 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "backends/meta-backend-private.h"
|
#include "backends/meta-backend-private.h"
|
||||||
#include "backends/meta-logical-monitor.h"
|
#include "backends/meta-logical-monitor.h"
|
||||||
#include "screen-private.h"
|
#include "x11/meta-x11-display-private.h"
|
||||||
#include <meta/workspace.h>
|
#include <meta/workspace.h>
|
||||||
|
#include "meta-workspace-manager-private.h"
|
||||||
#include "workspace-private.h"
|
#include "workspace-private.h"
|
||||||
#include "boxes-private.h"
|
#include "boxes-private.h"
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
|
|
||||||
#include <meta/compositor.h>
|
#include <meta/compositor.h>
|
||||||
@@ -221,17 +222,20 @@ meta_workspace_init (MetaWorkspace *workspace)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaWorkspace*
|
MetaWorkspace *
|
||||||
meta_workspace_new (MetaScreen *screen)
|
meta_workspace_new (MetaWorkspaceManager *workspace_manager)
|
||||||
{
|
{
|
||||||
|
MetaDisplay *display = workspace_manager->display;
|
||||||
MetaWorkspace *workspace;
|
MetaWorkspace *workspace;
|
||||||
GSList *windows, *l;
|
GSList *windows, *l;
|
||||||
|
|
||||||
workspace = g_object_new (META_TYPE_WORKSPACE, NULL);
|
workspace = g_object_new (META_TYPE_WORKSPACE, NULL);
|
||||||
|
|
||||||
workspace->screen = screen;
|
workspace->display = display;
|
||||||
workspace->screen->workspaces =
|
workspace->manager = workspace_manager;
|
||||||
g_list_append (workspace->screen->workspaces, workspace);
|
|
||||||
|
workspace_manager->workspaces =
|
||||||
|
g_list_append (workspace_manager->workspaces, workspace);
|
||||||
workspace->windows = NULL;
|
workspace->windows = NULL;
|
||||||
workspace->mru_list = NULL;
|
workspace->mru_list = NULL;
|
||||||
|
|
||||||
@@ -252,7 +256,7 @@ meta_workspace_new (MetaScreen *screen)
|
|||||||
workspace->showing_desktop = FALSE;
|
workspace->showing_desktop = FALSE;
|
||||||
|
|
||||||
/* make sure sticky windows are in our mru_list */
|
/* make sure sticky windows are in our mru_list */
|
||||||
windows = meta_display_list_windows (screen->display, META_LIST_SORTED);
|
windows = meta_display_list_windows (display, META_LIST_SORTED);
|
||||||
for (l = windows; l; l = l->next)
|
for (l = windows; l; l = l->next)
|
||||||
if (meta_window_located_on_workspace (l->data, workspace))
|
if (meta_window_located_on_workspace (l->data, workspace))
|
||||||
meta_workspace_add_window (workspace, l->data);
|
meta_workspace_add_window (workspace, l->data);
|
||||||
@@ -318,12 +322,14 @@ assert_workspace_empty (MetaWorkspace *workspace)
|
|||||||
void
|
void
|
||||||
meta_workspace_remove (MetaWorkspace *workspace)
|
meta_workspace_remove (MetaWorkspace *workspace)
|
||||||
{
|
{
|
||||||
g_return_if_fail (workspace != workspace->screen->active_workspace);
|
MetaWorkspaceManager *manager = workspace->display->workspace_manager;
|
||||||
|
|
||||||
|
g_return_if_fail (workspace != manager->active_workspace);
|
||||||
|
|
||||||
assert_workspace_empty (workspace);
|
assert_workspace_empty (workspace);
|
||||||
|
|
||||||
workspace->screen->workspaces =
|
manager->workspaces =
|
||||||
g_list_remove (workspace->screen->workspaces, workspace);
|
g_list_remove (manager->workspaces, workspace);
|
||||||
|
|
||||||
meta_workspace_clear_logical_monitor_data (workspace);
|
meta_workspace_clear_logical_monitor_data (workspace);
|
||||||
|
|
||||||
@@ -438,14 +444,14 @@ workspace_switch_sound(MetaWorkspace *from,
|
|||||||
int i, nw, x, y, fi, ti;
|
int i, nw, x, y, fi, ti;
|
||||||
const char *e;
|
const char *e;
|
||||||
|
|
||||||
nw = meta_screen_get_n_workspaces(from->screen);
|
nw = meta_workspace_manager_get_n_workspaces (from->manager);
|
||||||
fi = meta_workspace_index(from);
|
fi = meta_workspace_index(from);
|
||||||
ti = meta_workspace_index(to);
|
ti = meta_workspace_index(to);
|
||||||
|
|
||||||
meta_screen_calc_workspace_layout(from->screen,
|
meta_workspace_manager_calc_workspace_layout (from->manager,
|
||||||
nw,
|
nw,
|
||||||
fi,
|
fi,
|
||||||
&layout);
|
&layout);
|
||||||
|
|
||||||
for (i = 0; i < nw; i++)
|
for (i = 0; i < nw; i++)
|
||||||
if (layout.grid[i] == ti)
|
if (layout.grid[i] == ti)
|
||||||
@@ -488,7 +494,7 @@ workspace_switch_sound(MetaWorkspace *from,
|
|||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
meta_screen_free_workspace_layout (&layout);
|
meta_workspace_manager_free_workspace_layout (&layout);
|
||||||
#endif /* HAVE_LIBCANBERRA */
|
#endif /* HAVE_LIBCANBERRA */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -518,8 +524,6 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
|
|||||||
{
|
{
|
||||||
MetaWorkspace *old;
|
MetaWorkspace *old;
|
||||||
MetaWindow *move_window;
|
MetaWindow *move_window;
|
||||||
MetaScreen *screen;
|
|
||||||
MetaDisplay *display;
|
|
||||||
MetaCompositor *comp;
|
MetaCompositor *comp;
|
||||||
MetaWorkspaceLayout layout1, layout2;
|
MetaWorkspaceLayout layout1, layout2;
|
||||||
gint num_workspaces, current_space, new_space;
|
gint num_workspaces, current_space, new_space;
|
||||||
@@ -528,36 +532,36 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
|
|||||||
meta_verbose ("Activating workspace %d\n",
|
meta_verbose ("Activating workspace %d\n",
|
||||||
meta_workspace_index (workspace));
|
meta_workspace_index (workspace));
|
||||||
|
|
||||||
if (workspace->screen->active_workspace == workspace)
|
if (workspace->manager->active_workspace == workspace)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Free any cached pointers to the workspaces's edges from
|
/* Free any cached pointers to the workspaces's edges from
|
||||||
* a current resize or move operation */
|
* a current resize or move operation */
|
||||||
meta_display_cleanup_edges (workspace->screen->display);
|
meta_display_cleanup_edges (workspace->display);
|
||||||
|
|
||||||
if (workspace->screen->active_workspace)
|
if (workspace->manager->active_workspace)
|
||||||
workspace_switch_sound (workspace->screen->active_workspace, workspace);
|
workspace_switch_sound (workspace->manager->active_workspace, workspace);
|
||||||
|
|
||||||
/* Note that old can be NULL; e.g. when starting up */
|
/* Note that old can be NULL; e.g. when starting up */
|
||||||
old = workspace->screen->active_workspace;
|
old = workspace->manager->active_workspace;
|
||||||
|
|
||||||
workspace->screen->active_workspace = workspace;
|
workspace->manager->active_workspace = workspace;
|
||||||
|
|
||||||
meta_screen_set_active_workspace_hint (workspace->screen);
|
g_signal_emit_by_name (workspace->manager, "active-workspace-changed");
|
||||||
|
|
||||||
|
if (old == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* If the "show desktop" mode is active for either the old workspace
|
/* If the "show desktop" mode is active for either the old workspace
|
||||||
* or the new one *but not both*, then update the
|
* or the new one *but not both*, then update the
|
||||||
* _net_showing_desktop hint
|
* _net_showing_desktop hint
|
||||||
*/
|
*/
|
||||||
if (old && (old->showing_desktop != workspace->showing_desktop))
|
if (old->showing_desktop != workspace->showing_desktop)
|
||||||
meta_screen_update_showing_desktop_hint (workspace->screen);
|
g_signal_emit_by_name (workspace->manager, "showing-desktop-changed");
|
||||||
|
|
||||||
if (old == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
move_window = NULL;
|
move_window = NULL;
|
||||||
if (meta_grab_op_is_moving (workspace->screen->display->grab_op))
|
if (meta_grab_op_is_moving (workspace->display->grab_op))
|
||||||
move_window = workspace->screen->display->grab_window;
|
move_window = workspace->display->grab_window;
|
||||||
|
|
||||||
if (move_window != NULL)
|
if (move_window != NULL)
|
||||||
{
|
{
|
||||||
@@ -578,19 +582,17 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
|
|||||||
/*
|
/*
|
||||||
* Notify the compositor that the active workspace is changing.
|
* Notify the compositor that the active workspace is changing.
|
||||||
*/
|
*/
|
||||||
screen = workspace->screen;
|
comp = meta_display_get_compositor (workspace->display);
|
||||||
display = meta_screen_get_display (screen);
|
|
||||||
comp = meta_display_get_compositor (display);
|
|
||||||
direction = 0;
|
direction = 0;
|
||||||
|
|
||||||
current_space = meta_workspace_index (old);
|
current_space = meta_workspace_index (old);
|
||||||
new_space = meta_workspace_index (workspace);
|
new_space = meta_workspace_index (workspace);
|
||||||
num_workspaces = meta_screen_get_n_workspaces (workspace->screen);
|
num_workspaces = meta_workspace_manager_get_n_workspaces (workspace->manager);
|
||||||
meta_screen_calc_workspace_layout (workspace->screen, num_workspaces,
|
meta_workspace_manager_calc_workspace_layout (workspace->manager, num_workspaces,
|
||||||
current_space, &layout1);
|
current_space, &layout1);
|
||||||
|
|
||||||
meta_screen_calc_workspace_layout (workspace->screen, num_workspaces,
|
meta_workspace_manager_calc_workspace_layout (workspace->manager, num_workspaces,
|
||||||
new_space, &layout2);
|
new_space, &layout2);
|
||||||
|
|
||||||
if (meta_get_locale_direction () == META_LOCALE_DIRECTION_RTL)
|
if (meta_get_locale_direction () == META_LOCALE_DIRECTION_RTL)
|
||||||
{
|
{
|
||||||
@@ -627,8 +629,8 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
|
|||||||
direction = META_MOTION_UP_LEFT;
|
direction = META_MOTION_UP_LEFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_screen_free_workspace_layout (&layout1);
|
meta_workspace_manager_free_workspace_layout (&layout1);
|
||||||
meta_screen_free_workspace_layout (&layout2);
|
meta_workspace_manager_free_workspace_layout (&layout2);
|
||||||
|
|
||||||
meta_compositor_switch_workspace (comp, old, workspace, direction);
|
meta_compositor_switch_workspace (comp, old, workspace, direction);
|
||||||
|
|
||||||
@@ -651,8 +653,8 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
|
|||||||
meta_workspace_focus_default_window (workspace, NULL, timestamp);
|
meta_workspace_focus_default_window (workspace, NULL, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Emit switched signal from screen.c */
|
meta_workspace_manager_workspace_switched (workspace->manager, current_space,
|
||||||
meta_screen_workspace_switched (screen, current_space, new_space, direction);
|
new_space, direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -667,7 +669,7 @@ meta_workspace_index (MetaWorkspace *workspace)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = g_list_index (workspace->screen->workspaces, workspace);
|
ret = g_list_index (workspace->manager->workspaces, workspace);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
meta_bug ("Workspace does not exist to index!\n");
|
meta_bug ("Workspace does not exist to index!\n");
|
||||||
@@ -703,7 +705,7 @@ meta_workspace_list_windows (MetaWorkspace *workspace)
|
|||||||
GSList *display_windows, *l;
|
GSList *display_windows, *l;
|
||||||
GList *workspace_windows;
|
GList *workspace_windows;
|
||||||
|
|
||||||
display_windows = meta_display_list_windows (workspace->screen->display,
|
display_windows = meta_display_list_windows (workspace->display,
|
||||||
META_LIST_DEFAULT);
|
META_LIST_DEFAULT);
|
||||||
|
|
||||||
workspace_windows = NULL;
|
workspace_windows = NULL;
|
||||||
@@ -740,8 +742,8 @@ meta_workspace_invalidate_work_area (MetaWorkspace *workspace)
|
|||||||
|
|
||||||
/* If we are in the middle of a resize or move operation, we
|
/* If we are in the middle of a resize or move operation, we
|
||||||
* might have cached pointers to the workspace's edges */
|
* might have cached pointers to the workspace's edges */
|
||||||
if (workspace == workspace->screen->active_workspace)
|
if (workspace == workspace->manager->active_workspace)
|
||||||
meta_display_cleanup_edges (workspace->screen->display);
|
meta_display_cleanup_edges (workspace->display);
|
||||||
|
|
||||||
meta_workspace_clear_logical_monitor_data (workspace);
|
meta_workspace_clear_logical_monitor_data (workspace);
|
||||||
|
|
||||||
@@ -767,7 +769,7 @@ meta_workspace_invalidate_work_area (MetaWorkspace *workspace)
|
|||||||
|
|
||||||
g_list_free (windows);
|
g_list_free (windows);
|
||||||
|
|
||||||
meta_screen_queue_workarea_recalc (workspace->screen);
|
meta_display_queue_workarea_recalc (workspace->display);
|
||||||
}
|
}
|
||||||
|
|
||||||
static MetaStrut *
|
static MetaStrut *
|
||||||
@@ -796,7 +798,7 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
|
|||||||
GList *windows;
|
GList *windows;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
GList *logical_monitors, *l;
|
GList *logical_monitors, *l;
|
||||||
MetaRectangle work_area;
|
MetaRectangle display_rect, work_area;
|
||||||
|
|
||||||
if (!workspace->work_areas_invalid)
|
if (!workspace->work_areas_invalid)
|
||||||
return;
|
return;
|
||||||
@@ -806,6 +808,9 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
|
|||||||
g_assert (workspace->screen_edges == NULL);
|
g_assert (workspace->screen_edges == NULL);
|
||||||
g_assert (workspace->monitor_edges == NULL);
|
g_assert (workspace->monitor_edges == NULL);
|
||||||
|
|
||||||
|
meta_display_get_size (workspace->display, &display_rect.width,
|
||||||
|
&display_rect.height);
|
||||||
|
|
||||||
/* STEP 1: Get the list of struts */
|
/* STEP 1: Get the list of struts */
|
||||||
|
|
||||||
workspace->all_struts = copy_strut_list (workspace->builtin_struts);
|
workspace->all_struts = copy_strut_list (workspace->builtin_struts);
|
||||||
@@ -848,13 +853,13 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
|
|||||||
|
|
||||||
workspace->screen_region =
|
workspace->screen_region =
|
||||||
meta_rectangle_get_minimal_spanning_set_for_region (
|
meta_rectangle_get_minimal_spanning_set_for_region (
|
||||||
&workspace->screen->rect,
|
&display_rect,
|
||||||
workspace->all_struts);
|
workspace->all_struts);
|
||||||
|
|
||||||
/* STEP 3: Get the work areas (region-to-maximize-to) for the screen and
|
/* STEP 3: Get the work areas (region-to-maximize-to) for the screen and
|
||||||
* monitors.
|
* monitors.
|
||||||
*/
|
*/
|
||||||
work_area = workspace->screen->rect; /* start with the screen */
|
work_area = display_rect; /* start with the screen */
|
||||||
if (workspace->screen_region == NULL)
|
if (workspace->screen_region == NULL)
|
||||||
work_area = meta_rect (0, 0, -1, -1);
|
work_area = meta_rect (0, 0, -1, -1);
|
||||||
else
|
else
|
||||||
@@ -871,7 +876,7 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
|
|||||||
work_area.width, MIN_SANE_AREA);
|
work_area.width, MIN_SANE_AREA);
|
||||||
if (work_area.width < 1)
|
if (work_area.width < 1)
|
||||||
{
|
{
|
||||||
work_area.x = (workspace->screen->rect.width - MIN_SANE_AREA)/2;
|
work_area.x = (display_rect.width - MIN_SANE_AREA)/2;
|
||||||
work_area.width = MIN_SANE_AREA;
|
work_area.width = MIN_SANE_AREA;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -888,7 +893,7 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
|
|||||||
work_area.height, MIN_SANE_AREA);
|
work_area.height, MIN_SANE_AREA);
|
||||||
if (work_area.height < 1)
|
if (work_area.height < 1)
|
||||||
{
|
{
|
||||||
work_area.y = (workspace->screen->rect.height - MIN_SANE_AREA)/2;
|
work_area.y = (display_rect.height - MIN_SANE_AREA)/2;
|
||||||
work_area.height = MIN_SANE_AREA;
|
work_area.height = MIN_SANE_AREA;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -955,7 +960,7 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
|
|||||||
g_assert (workspace->screen_edges == NULL);
|
g_assert (workspace->screen_edges == NULL);
|
||||||
g_assert (workspace->monitor_edges == NULL);
|
g_assert (workspace->monitor_edges == NULL);
|
||||||
workspace->screen_edges =
|
workspace->screen_edges =
|
||||||
meta_rectangle_find_onscreen_edges (&workspace->screen->rect,
|
meta_rectangle_find_onscreen_edges (&display_rect,
|
||||||
workspace->all_struts);
|
workspace->all_struts);
|
||||||
tmp = NULL;
|
tmp = NULL;
|
||||||
for (l = logical_monitors; l; l = l->next)
|
for (l = logical_monitors; l; l = l->next)
|
||||||
@@ -1006,9 +1011,12 @@ meta_workspace_set_builtin_struts (MetaWorkspace *workspace,
|
|||||||
MetaBackend *backend = meta_get_backend ();
|
MetaBackend *backend = meta_get_backend ();
|
||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
meta_backend_get_monitor_manager (backend);
|
meta_backend_get_monitor_manager (backend);
|
||||||
MetaScreen *screen = workspace->screen;
|
MetaDisplay *display = workspace->display;
|
||||||
|
MetaRectangle display_rect;
|
||||||
GSList *l;
|
GSList *l;
|
||||||
|
|
||||||
|
meta_display_get_size (display, &display_rect.width, &display_rect.height);
|
||||||
|
|
||||||
for (l = struts; l; l = l->next)
|
for (l = struts; l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaStrut *strut = l->data;
|
MetaStrut *strut = l->data;
|
||||||
@@ -1023,7 +1031,7 @@ meta_workspace_set_builtin_struts (MetaWorkspace *workspace,
|
|||||||
case META_SIDE_TOP:
|
case META_SIDE_TOP:
|
||||||
if (meta_monitor_manager_get_logical_monitor_neighbor (monitor_manager,
|
if (meta_monitor_manager_get_logical_monitor_neighbor (monitor_manager,
|
||||||
logical_monitor,
|
logical_monitor,
|
||||||
META_SCREEN_UP))
|
META_DISPLAY_UP))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
strut->rect.height += strut->rect.y;
|
strut->rect.height += strut->rect.y;
|
||||||
@@ -1032,15 +1040,15 @@ meta_workspace_set_builtin_struts (MetaWorkspace *workspace,
|
|||||||
case META_SIDE_BOTTOM:
|
case META_SIDE_BOTTOM:
|
||||||
if (meta_monitor_manager_get_logical_monitor_neighbor (monitor_manager,
|
if (meta_monitor_manager_get_logical_monitor_neighbor (monitor_manager,
|
||||||
logical_monitor,
|
logical_monitor,
|
||||||
META_SCREEN_DOWN))
|
META_DISPLAY_DOWN))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
strut->rect.height = screen->rect.height - strut->rect.y;
|
strut->rect.height = display_rect.height - strut->rect.y;
|
||||||
break;
|
break;
|
||||||
case META_SIDE_LEFT:
|
case META_SIDE_LEFT:
|
||||||
if (meta_monitor_manager_get_logical_monitor_neighbor (monitor_manager,
|
if (meta_monitor_manager_get_logical_monitor_neighbor (monitor_manager,
|
||||||
logical_monitor,
|
logical_monitor,
|
||||||
META_SCREEN_LEFT))
|
META_DISPLAY_LEFT))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
strut->rect.width += strut->rect.x;
|
strut->rect.width += strut->rect.x;
|
||||||
@@ -1049,10 +1057,10 @@ meta_workspace_set_builtin_struts (MetaWorkspace *workspace,
|
|||||||
case META_SIDE_RIGHT:
|
case META_SIDE_RIGHT:
|
||||||
if (meta_monitor_manager_get_logical_monitor_neighbor (monitor_manager,
|
if (meta_monitor_manager_get_logical_monitor_neighbor (monitor_manager,
|
||||||
logical_monitor,
|
logical_monitor,
|
||||||
META_SCREEN_RIGHT))
|
META_DISPLAY_RIGHT))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
strut->rect.width = screen->rect.width - strut->rect.x;
|
strut->rect.width = display_rect.width - strut->rect.x;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1195,9 +1203,9 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
|
|||||||
gboolean ltr;
|
gboolean ltr;
|
||||||
|
|
||||||
current_space = meta_workspace_index (workspace);
|
current_space = meta_workspace_index (workspace);
|
||||||
num_workspaces = meta_screen_get_n_workspaces (workspace->screen);
|
num_workspaces = meta_workspace_manager_get_n_workspaces (workspace->manager);
|
||||||
meta_screen_calc_workspace_layout (workspace->screen, num_workspaces,
|
meta_workspace_manager_calc_workspace_layout (workspace->manager, num_workspaces,
|
||||||
current_space, &layout);
|
current_space, &layout);
|
||||||
|
|
||||||
meta_verbose ("Getting neighbor of %d in direction %s\n",
|
meta_verbose ("Getting neighbor of %d in direction %s\n",
|
||||||
current_space, meta_motion_direction_to_string (direction));
|
current_space, meta_motion_direction_to_string (direction));
|
||||||
@@ -1242,9 +1250,9 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
|
|||||||
meta_verbose ("Neighbor workspace is %d at row %d col %d\n",
|
meta_verbose ("Neighbor workspace is %d at row %d col %d\n",
|
||||||
i, layout.current_row, layout.current_col);
|
i, layout.current_row, layout.current_col);
|
||||||
|
|
||||||
meta_screen_free_workspace_layout (&layout);
|
meta_workspace_manager_free_workspace_layout (&layout);
|
||||||
|
|
||||||
return meta_screen_get_workspace_by_index (workspace->screen, i);
|
return meta_workspace_manager_get_workspace_by_index (workspace->manager, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
@@ -1258,26 +1266,26 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
|
|||||||
MetaWindow *not_this_one,
|
MetaWindow *not_this_one,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
if (timestamp == CurrentTime)
|
if (timestamp == META_CURRENT_TIME)
|
||||||
meta_warning ("CurrentTime used to choose focus window; "
|
meta_warning ("META_CURRENT_TIME used to choose focus window; "
|
||||||
"focus window may not be correct.\n");
|
"focus window may not be correct.\n");
|
||||||
|
|
||||||
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK ||
|
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK ||
|
||||||
!workspace->screen->display->mouse_mode)
|
!workspace->display->mouse_mode)
|
||||||
focus_ancestor_or_top_window (workspace, not_this_one, timestamp);
|
focus_ancestor_or_top_window (workspace, not_this_one, timestamp);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MetaWindow * window;
|
MetaWindow * window;
|
||||||
window = meta_screen_get_mouse_window (workspace->screen, not_this_one);
|
window = meta_display_get_pointer_window (workspace->display, not_this_one);
|
||||||
if (window &&
|
if (window &&
|
||||||
window->type != META_WINDOW_DOCK &&
|
window->type != META_WINDOW_DOCK &&
|
||||||
window->type != META_WINDOW_DESKTOP)
|
window->type != META_WINDOW_DESKTOP)
|
||||||
{
|
{
|
||||||
if (timestamp == CurrentTime)
|
if (timestamp == META_CURRENT_TIME)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* We would like for this to never happen. However, if
|
/* We would like for this to never happen. However, if
|
||||||
* it does happen then we kludge since using CurrentTime
|
* it does happen then we kludge since using META_CURRENT_TIME
|
||||||
* can mean ugly race conditions--and we can avoid these
|
* can mean ugly race conditions--and we can avoid these
|
||||||
* by allowing EnterNotify events (which come with
|
* by allowing EnterNotify events (which come with
|
||||||
* timestamps) to handle focus.
|
* timestamps) to handle focus.
|
||||||
@@ -1293,11 +1301,10 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
|
|||||||
meta_window_focus (window, timestamp);
|
meta_window_focus (window, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workspace->screen->display->autoraise_window != window &&
|
if (workspace->display->autoraise_window != window &&
|
||||||
meta_prefs_get_auto_raise ())
|
meta_prefs_get_auto_raise ())
|
||||||
{
|
{
|
||||||
meta_display_queue_autoraise_callback (workspace->screen->display,
|
meta_display_queue_autoraise_callback (workspace->display, window);
|
||||||
window);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_SLOPPY)
|
else if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_SLOPPY)
|
||||||
@@ -1307,9 +1314,8 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
|
|||||||
meta_topic (META_DEBUG_FOCUS,
|
meta_topic (META_DEBUG_FOCUS,
|
||||||
"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_x11_display_focus_the_no_focus_window (workspace->display->x11_display,
|
||||||
workspace->screen,
|
timestamp);
|
||||||
timestamp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1363,7 +1369,7 @@ focus_ancestor_or_top_window (MetaWorkspace *workspace,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window = meta_stack_get_default_focus_window (workspace->screen->stack,
|
window = meta_stack_get_default_focus_window (workspace->display->stack,
|
||||||
workspace,
|
workspace,
|
||||||
not_this_one);
|
not_this_one);
|
||||||
|
|
||||||
@@ -1381,23 +1387,21 @@ focus_ancestor_or_top_window (MetaWorkspace *workspace,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
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_x11_display_focus_the_no_focus_window (workspace->display->x11_display,
|
||||||
workspace->screen,
|
timestamp);
|
||||||
timestamp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_workspace_get_screen:
|
* meta_workspace_get_display:
|
||||||
* @workspace: a #MetaWorkspace
|
* @workspace: a #MetaWorkspace
|
||||||
*
|
*
|
||||||
* Gets the #MetaScreen that the workspace is part of.
|
* Gets the #MetaDisplay that the workspace is part of.
|
||||||
*
|
*
|
||||||
* Return value: (transfer none): the #MetaScreen for the workspace
|
* Return value: (transfer none): the #MetaDisplay for the workspace
|
||||||
*/
|
*/
|
||||||
MetaScreen *
|
MetaDisplay *
|
||||||
meta_workspace_get_screen (MetaWorkspace *workspace)
|
meta_workspace_get_display (MetaWorkspace *workspace)
|
||||||
{
|
{
|
||||||
return workspace->screen;
|
return workspace->display;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,9 @@
|
|||||||
#define META_VIRTUAL_CORE_POINTER_ID 2
|
#define META_VIRTUAL_CORE_POINTER_ID 2
|
||||||
#define META_VIRTUAL_CORE_KEYBOARD_ID 3
|
#define META_VIRTUAL_CORE_KEYBOARD_ID 3
|
||||||
|
|
||||||
|
/* Replacement for X11 CurrentTime */
|
||||||
|
#define META_CURRENT_TIME 0L
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaFrameFlags:
|
* MetaFrameFlags:
|
||||||
* @META_FRAME_ALLOWS_DELETE: frame allows delete
|
* @META_FRAME_ALLOWS_DELETE: frame allows delete
|
||||||
|
|||||||
@@ -32,21 +32,21 @@
|
|||||||
#include <meta/meta-window-actor.h>
|
#include <meta/meta-window-actor.h>
|
||||||
|
|
||||||
/* Public compositor API */
|
/* Public compositor API */
|
||||||
ClutterActor *meta_get_stage_for_screen (MetaScreen *screen);
|
ClutterActor *meta_get_stage_for_display (MetaDisplay *display);
|
||||||
Window meta_get_overlay_window (MetaScreen *screen);
|
Window meta_get_overlay_window (MetaDisplay *display);
|
||||||
GList *meta_get_window_actors (MetaScreen *screen);
|
GList *meta_get_window_actors (MetaDisplay *display);
|
||||||
ClutterActor *meta_get_window_group_for_screen (MetaScreen *screen);
|
ClutterActor *meta_get_window_group_for_display (MetaDisplay *display);
|
||||||
ClutterActor *meta_get_top_window_group_for_screen (MetaScreen *screen);
|
ClutterActor *meta_get_top_window_group_for_display (MetaDisplay *display);
|
||||||
ClutterActor *meta_get_feedback_group_for_screen (MetaScreen *screen);
|
ClutterActor *meta_get_feedback_group_for_display (MetaDisplay *display);
|
||||||
|
|
||||||
void meta_disable_unredirect_for_screen (MetaScreen *screen);
|
void meta_disable_unredirect_for_display (MetaDisplay *display);
|
||||||
void meta_enable_unredirect_for_screen (MetaScreen *screen);
|
void meta_enable_unredirect_for_display (MetaDisplay *display);
|
||||||
|
|
||||||
void meta_set_stage_input_region (MetaScreen *screen,
|
void meta_set_stage_input_region (MetaDisplay *display,
|
||||||
XserverRegion region);
|
XserverRegion region);
|
||||||
void meta_empty_stage_input_region (MetaScreen *screen);
|
void meta_empty_stage_input_region (MetaDisplay *display);
|
||||||
void meta_focus_stage_window (MetaScreen *screen,
|
void meta_focus_stage_window (MetaDisplay *display,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
gboolean meta_stage_is_focused (MetaScreen *screen);
|
gboolean meta_stage_is_focused (MetaDisplay *display);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -114,8 +114,8 @@ void meta_compositor_queue_frame_drawn (MetaCompositor *compositor,
|
|||||||
void meta_compositor_sync_stack (MetaCompositor *compositor,
|
void meta_compositor_sync_stack (MetaCompositor *compositor,
|
||||||
GList *stack);
|
GList *stack);
|
||||||
|
|
||||||
void meta_compositor_flash_screen (MetaCompositor *compositor,
|
void meta_compositor_flash_display (MetaCompositor *compositor,
|
||||||
MetaScreen *screen);
|
MetaDisplay *display);
|
||||||
|
|
||||||
void meta_compositor_show_tile_preview (MetaCompositor *compositor,
|
void meta_compositor_show_tile_preview (MetaCompositor *compositor,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include <meta/types.h>
|
#include <meta/types.h>
|
||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
#include <meta/common.h>
|
#include <meta/common.h>
|
||||||
|
#include <meta/workspace.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaTabList:
|
* MetaTabList:
|
||||||
@@ -73,21 +74,13 @@ GType meta_display_get_type (void) G_GNUC_CONST;
|
|||||||
|
|
||||||
#define meta_XFree(p) do { if ((p)) XFree ((p)); } while (0)
|
#define meta_XFree(p) do { if ((p)) XFree ((p)); } while (0)
|
||||||
|
|
||||||
int meta_display_get_xinput_opcode (MetaDisplay *display);
|
|
||||||
gboolean meta_display_supports_extended_barriers (MetaDisplay *display);
|
gboolean meta_display_supports_extended_barriers (MetaDisplay *display);
|
||||||
Display *meta_display_get_xdisplay (MetaDisplay *display);
|
|
||||||
MetaCompositor *meta_display_get_compositor (MetaDisplay *display);
|
|
||||||
|
|
||||||
gboolean meta_display_has_shape (MetaDisplay *display);
|
MetaCompositor *meta_display_get_compositor (MetaDisplay *display);
|
||||||
|
MetaX11Display *meta_display_get_x11_display (MetaDisplay *display);
|
||||||
|
|
||||||
MetaWindow *meta_display_get_focus_window (MetaDisplay *display);
|
MetaWindow *meta_display_get_focus_window (MetaDisplay *display);
|
||||||
|
|
||||||
gboolean meta_display_xwindow_is_a_no_focus_window (MetaDisplay *display,
|
|
||||||
Window xwindow);
|
|
||||||
|
|
||||||
int meta_display_get_damage_event_base (MetaDisplay *display);
|
|
||||||
int meta_display_get_shape_event_base (MetaDisplay *display);
|
|
||||||
|
|
||||||
gboolean meta_display_xserver_time_is_before (MetaDisplay *display,
|
gboolean meta_display_xserver_time_is_before (MetaDisplay *display,
|
||||||
guint32 time1,
|
guint32 time1,
|
||||||
guint32 time2);
|
guint32 time2);
|
||||||
@@ -111,7 +104,6 @@ MetaWindow* meta_display_get_tab_current (MetaDisplay *display,
|
|||||||
MetaWorkspace *workspace);
|
MetaWorkspace *workspace);
|
||||||
|
|
||||||
gboolean meta_display_begin_grab_op (MetaDisplay *display,
|
gboolean meta_display_begin_grab_op (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaGrabOp op,
|
MetaGrabOp op,
|
||||||
gboolean pointer_already_grabbed,
|
gboolean pointer_already_grabbed,
|
||||||
@@ -145,38 +137,12 @@ guint meta_display_get_keybinding_action (MetaDisplay *display,
|
|||||||
unsigned int keycode,
|
unsigned int keycode,
|
||||||
unsigned long mask);
|
unsigned long mask);
|
||||||
|
|
||||||
/* meta_display_set_input_focus_window is like XSetInputFocus, except
|
|
||||||
* that (a) it can't detect timestamps later than the current time,
|
|
||||||
* since Mutter isn't part of the XServer, and thus gives erroneous
|
|
||||||
* behavior in this circumstance (so don't do it), (b) it uses
|
|
||||||
* display->last_focus_time since we don't have access to the true
|
|
||||||
* Xserver one, (c) it makes use of display->user_time since checking
|
|
||||||
* whether a window should be allowed to be focused should depend
|
|
||||||
* on user_time events (see bug 167358, comment 15 in particular)
|
|
||||||
*/
|
|
||||||
void meta_display_set_input_focus_window (MetaDisplay *display,
|
|
||||||
MetaWindow *window,
|
|
||||||
gboolean focus_frame,
|
|
||||||
guint32 timestamp);
|
|
||||||
|
|
||||||
/* meta_display_focus_the_no_focus_window is called when the
|
|
||||||
* designated no_focus_window should be focused, but is otherwise the
|
|
||||||
* same as meta_display_set_input_focus_window
|
|
||||||
*/
|
|
||||||
void meta_display_focus_the_no_focus_window (MetaDisplay *display,
|
|
||||||
MetaScreen *screen,
|
|
||||||
guint32 timestamp);
|
|
||||||
|
|
||||||
GSList *meta_display_sort_windows_by_stacking (MetaDisplay *display,
|
GSList *meta_display_sort_windows_by_stacking (MetaDisplay *display,
|
||||||
GSList *windows);
|
GSList *windows);
|
||||||
|
|
||||||
void meta_display_add_ignored_crossing_serial (MetaDisplay *display,
|
void meta_display_add_ignored_crossing_serial (MetaDisplay *display,
|
||||||
unsigned long serial);
|
unsigned long serial);
|
||||||
|
|
||||||
void meta_display_unmanage_screen (MetaDisplay *display,
|
|
||||||
MetaScreen *screen,
|
|
||||||
guint32 timestamp);
|
|
||||||
|
|
||||||
void meta_display_clear_mouse_mode (MetaDisplay *display);
|
void meta_display_clear_mouse_mode (MetaDisplay *display);
|
||||||
|
|
||||||
void meta_display_freeze_keyboard (MetaDisplay *display,
|
void meta_display_freeze_keyboard (MetaDisplay *display,
|
||||||
@@ -196,4 +162,65 @@ gchar * meta_display_get_pad_action_label (MetaDisplay *display,
|
|||||||
MetaPadActionType action_type,
|
MetaPadActionType action_type,
|
||||||
guint action_number);
|
guint action_number);
|
||||||
|
|
||||||
|
void meta_display_get_size (MetaDisplay *display,
|
||||||
|
int *width,
|
||||||
|
int *height);
|
||||||
|
|
||||||
|
void meta_display_set_cursor (MetaDisplay *display,
|
||||||
|
MetaCursor cursor);
|
||||||
|
|
||||||
|
GSList *meta_display_get_startup_sequences (MetaDisplay *display);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MetaDisplayDirection:
|
||||||
|
* @META_DISPLAY_UP: up
|
||||||
|
* @META_DISPLAY_DOWN: down
|
||||||
|
* @META_DISPLAY_LEFT: left
|
||||||
|
* @META_DISPLAY_RIGHT: right
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
META_DISPLAY_UP,
|
||||||
|
META_DISPLAY_DOWN,
|
||||||
|
META_DISPLAY_LEFT,
|
||||||
|
META_DISPLAY_RIGHT
|
||||||
|
} MetaDisplayDirection;
|
||||||
|
|
||||||
|
int meta_display_get_n_monitors (MetaDisplay *display);
|
||||||
|
int meta_display_get_primary_monitor (MetaDisplay *display);
|
||||||
|
int meta_display_get_current_monitor (MetaDisplay *display);
|
||||||
|
void meta_display_get_monitor_geometry (MetaDisplay *display,
|
||||||
|
int monitor,
|
||||||
|
MetaRectangle *geometry);
|
||||||
|
|
||||||
|
gboolean meta_display_get_monitor_in_fullscreen (MetaDisplay *display,
|
||||||
|
int monitor);
|
||||||
|
|
||||||
|
int meta_display_get_monitor_index_for_rect (MetaDisplay *display,
|
||||||
|
MetaRectangle *rect);
|
||||||
|
|
||||||
|
int meta_display_get_monitor_neighbor_index (MetaDisplay *display,
|
||||||
|
int which_monitor,
|
||||||
|
MetaDisplayDirection dir);
|
||||||
|
|
||||||
|
void meta_display_focus_default_window (MetaDisplay *display,
|
||||||
|
guint32 timestamp);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MetaDisplayCorner:
|
||||||
|
* @META_DISPLAY_TOPLEFT: top-left corner
|
||||||
|
* @META_DISPLAY_TOPRIGHT: top-right corner
|
||||||
|
* @META_DISPLAY_BOTTOMLEFT: bottom-left corner
|
||||||
|
* @META_DISPLAY_BOTTOMRIGHT: bottom-right corner
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
META_DISPLAY_TOPLEFT,
|
||||||
|
META_DISPLAY_TOPRIGHT,
|
||||||
|
META_DISPLAY_BOTTOMLEFT,
|
||||||
|
META_DISPLAY_BOTTOMRIGHT
|
||||||
|
} MetaDisplayCorner;
|
||||||
|
|
||||||
|
MetaWorkspaceManager *meta_display_get_workspace_manager (MetaDisplay *display);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ void meta_window_shutdown_group (MetaWindow *window);
|
|||||||
void meta_window_group_leader_changed (MetaWindow *window);
|
void meta_window_group_leader_changed (MetaWindow *window);
|
||||||
|
|
||||||
/* note, can return NULL */
|
/* note, can return NULL */
|
||||||
MetaGroup* meta_display_lookup_group (MetaDisplay *display,
|
MetaGroup *meta_x11_display_lookup_group (MetaX11Display *x11_display,
|
||||||
Window group_leader);
|
Window group_leader);
|
||||||
|
|
||||||
GSList* meta_group_list_windows (MetaGroup *group);
|
GSList* meta_group_list_windows (MetaGroup *group);
|
||||||
|
|
||||||
@@ -49,7 +49,3 @@ gboolean meta_group_property_notify (MetaGroup *group,
|
|||||||
XEvent *event);
|
XEvent *event);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#define META_BACKGROUND_ACTOR_H
|
#define META_BACKGROUND_ACTOR_H
|
||||||
|
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
#include <meta/screen.h>
|
|
||||||
#include <meta/meta-background.h>
|
#include <meta/meta-background.h>
|
||||||
|
|
||||||
#include <gsettings-desktop-schemas/gdesktop-enums.h>
|
#include <gsettings-desktop-schemas/gdesktop-enums.h>
|
||||||
@@ -61,8 +60,8 @@ struct _MetaBackgroundActor
|
|||||||
|
|
||||||
GType meta_background_actor_get_type (void);
|
GType meta_background_actor_get_type (void);
|
||||||
|
|
||||||
ClutterActor *meta_background_actor_new (MetaScreen *screen,
|
ClutterActor *meta_background_actor_new (MetaDisplay *display,
|
||||||
int monitor);
|
int monitor);
|
||||||
|
|
||||||
void meta_background_actor_set_background (MetaBackgroundActor *self,
|
void meta_background_actor_set_background (MetaBackgroundActor *self,
|
||||||
MetaBackground *background);
|
MetaBackground *background);
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
#include <gsettings-desktop-schemas/gdesktop-enums.h>
|
#include <gsettings-desktop-schemas/gdesktop-enums.h>
|
||||||
#include <meta/screen.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaBackground:
|
* MetaBackground:
|
||||||
@@ -61,7 +60,7 @@ void meta_background_refresh_all (void);
|
|||||||
|
|
||||||
GType meta_background_get_type (void);
|
GType meta_background_get_type (void);
|
||||||
|
|
||||||
MetaBackground *meta_background_new (MetaScreen *screen);
|
MetaBackground *meta_background_new (MetaDisplay *display);
|
||||||
|
|
||||||
void meta_background_set_color (MetaBackground *self,
|
void meta_background_set_color (MetaBackground *self,
|
||||||
ClutterColor *color);
|
ClutterColor *color);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ typedef struct _MetaCursorTrackerClass MetaCursorTrackerClass;
|
|||||||
|
|
||||||
GType meta_cursor_tracker_get_type (void);
|
GType meta_cursor_tracker_get_type (void);
|
||||||
|
|
||||||
MetaCursorTracker *meta_cursor_tracker_get_for_screen (MetaScreen *screen);
|
MetaCursorTracker *meta_cursor_tracker_get_for_display (MetaDisplay *display);
|
||||||
|
|
||||||
void meta_cursor_tracker_get_hot (MetaCursorTracker *tracker,
|
void meta_cursor_tracker_get_hot (MetaCursorTracker *tracker,
|
||||||
int *x,
|
int *x,
|
||||||
|
|||||||
@@ -421,7 +421,7 @@ void
|
|||||||
meta_plugin_end_modal (MetaPlugin *plugin,
|
meta_plugin_end_modal (MetaPlugin *plugin,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
|
|
||||||
MetaScreen *meta_plugin_get_screen (MetaPlugin *plugin);
|
MetaDisplay *meta_plugin_get_display (MetaPlugin *plugin);
|
||||||
|
|
||||||
void _meta_plugin_set_compositor (MetaPlugin *plugin, MetaCompositor *compositor);
|
void _meta_plugin_set_compositor (MetaPlugin *plugin, MetaCompositor *compositor);
|
||||||
|
|
||||||
|
|||||||
59
src/meta/meta-workspace-manager.h
Normal file
59
src/meta/meta-workspace-manager.h
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2001 Havoc Pennington
|
||||||
|
* Copyright (C) 2002, 2003, 2004 Red Hat, Inc.
|
||||||
|
* Copyright (C) 2003, 2004 Rob Adams
|
||||||
|
* Copyright (C) 2004-2006 Elijah Newren
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef META_WORKSPACE_MANAGER_H
|
||||||
|
#define META_WORKSPACE_MANAGER_H
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
#include <meta/common.h>
|
||||||
|
#include <meta/prefs.h>
|
||||||
|
#include <meta/types.h>
|
||||||
|
|
||||||
|
#define META_TYPE_WORKSPACE_MANAGER (meta_workspace_manager_get_type ())
|
||||||
|
G_DECLARE_FINAL_TYPE (MetaWorkspaceManager, meta_workspace_manager, META, WORKSPACE_MANAGER, GObject)
|
||||||
|
|
||||||
|
GList *meta_workspace_manager_get_workspaces (MetaWorkspaceManager *workspace_manager);
|
||||||
|
|
||||||
|
int meta_workspace_manager_get_n_workspaces (MetaWorkspaceManager *workspace_manager);
|
||||||
|
|
||||||
|
MetaWorkspace* meta_workspace_manager_get_workspace_by_index (MetaWorkspaceManager *workspace_manager,
|
||||||
|
int index);
|
||||||
|
|
||||||
|
void meta_workspace_manager_remove_workspace (MetaWorkspaceManager *workspace_manager,
|
||||||
|
MetaWorkspace *workspace,
|
||||||
|
guint32 timestamp);
|
||||||
|
|
||||||
|
MetaWorkspace *meta_workspace_manager_append_new_workspace (MetaWorkspaceManager *workspace_manager,
|
||||||
|
gboolean activate,
|
||||||
|
guint32 timestamp);
|
||||||
|
|
||||||
|
int meta_workspace_manager_get_active_workspace_index (MetaWorkspaceManager *workspace_manager);
|
||||||
|
|
||||||
|
MetaWorkspace *meta_workspace_manager_get_active_workspace (MetaWorkspaceManager *workspace_manager);
|
||||||
|
|
||||||
|
void meta_workspace_manager_override_workspace_layout (MetaWorkspaceManager *workspace_manager,
|
||||||
|
MetaDisplayCorner starting_corner,
|
||||||
|
gboolean vertical_layout,
|
||||||
|
int n_rows,
|
||||||
|
int n_columns);
|
||||||
|
#endif /* META_WORKSPACE_MANAGER_H */
|
||||||
68
src/meta/meta-x11-display.h
Normal file
68
src/meta/meta-x11-display.h
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2008 Iain Holmes
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef META_X11_DISPLAY_H
|
||||||
|
#define META_X11_DISPLAY_H
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
|
#include <meta/common.h>
|
||||||
|
#include <meta/prefs.h>
|
||||||
|
#include <meta/types.h>
|
||||||
|
|
||||||
|
#define META_TYPE_X11_DISPLAY (meta_x11_display_get_type ())
|
||||||
|
G_DECLARE_FINAL_TYPE (MetaX11Display, meta_x11_display, META, X11_DISPLAY, GObject)
|
||||||
|
|
||||||
|
int meta_x11_display_get_screen_number (MetaX11Display *x11_display);
|
||||||
|
Display *meta_x11_display_get_xdisplay (MetaX11Display *x11_display);
|
||||||
|
Window meta_x11_display_get_xroot (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
int meta_x11_display_get_xinput_opcode (MetaX11Display *x11_display);
|
||||||
|
int meta_x11_display_get_damage_event_base (MetaX11Display *x11_display);
|
||||||
|
int meta_x11_display_get_shape_event_base (MetaX11Display *x11_display);
|
||||||
|
gboolean meta_x11_display_has_shape (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
void meta_x11_display_set_cm_selection (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
gboolean meta_x11_display_xwindow_is_a_no_focus_window (MetaX11Display *x11_display,
|
||||||
|
Window xwindow);
|
||||||
|
|
||||||
|
/* meta_x11_display_set_input_focus_window is like XSetInputFocus, except
|
||||||
|
* that (a) it can't detect timestamps later than the current time,
|
||||||
|
* since Mutter isn't part of the XServer, and thus gives erroneous
|
||||||
|
* behavior in this circumstance (so don't do it), (b) it uses
|
||||||
|
* display->last_focus_time since we don't have access to the true
|
||||||
|
* Xserver one, (c) it makes use of display->user_time since checking
|
||||||
|
* whether a window should be allowed to be focused should depend
|
||||||
|
* on user_time events (see bug 167358, comment 15 in particular)
|
||||||
|
*/
|
||||||
|
void meta_x11_display_set_input_focus_window (MetaX11Display *x11_display,
|
||||||
|
MetaWindow *window,
|
||||||
|
gboolean focus_frame,
|
||||||
|
guint32 timestamp);
|
||||||
|
|
||||||
|
/* meta_x11_display_focus_the_no_focus_window is called when the
|
||||||
|
* designated no_focus_window should be focused, but is otherwise the
|
||||||
|
* same as meta_display_set_input_focus_window
|
||||||
|
*/
|
||||||
|
void meta_x11_display_focus_the_no_focus_window (MetaX11Display *x11_display,
|
||||||
|
guint32 timestamp);
|
||||||
|
|
||||||
|
#endif /* META_X11_DISPLAY_H */
|
||||||
@@ -25,13 +25,13 @@
|
|||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
#include <meta/util.h>
|
#include <meta/util.h>
|
||||||
#include <meta/display.h>
|
#include <meta/meta-x11-display.h>
|
||||||
|
|
||||||
void meta_error_trap_push (MetaDisplay *display);
|
void meta_x11_error_trap_push (MetaX11Display *x11_display);
|
||||||
void meta_error_trap_pop (MetaDisplay *display);
|
void meta_x11_error_trap_pop (MetaX11Display *x11_display);
|
||||||
|
|
||||||
/* returns X error code, or 0 for no error */
|
/* returns X error code, or 0 for no error */
|
||||||
int meta_error_trap_pop_with_return (MetaDisplay *display);
|
int meta_x11_error_trap_pop_with_return (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -140,7 +140,9 @@ gboolean meta_prefs_get_gnome_animations (void);
|
|||||||
gboolean meta_prefs_get_edge_tiling (void);
|
gboolean meta_prefs_get_edge_tiling (void);
|
||||||
gboolean meta_prefs_get_auto_maximize (void);
|
gboolean meta_prefs_get_auto_maximize (void);
|
||||||
gboolean meta_prefs_get_center_new_windows (void);
|
gboolean meta_prefs_get_center_new_windows (void);
|
||||||
|
|
||||||
gboolean meta_prefs_get_show_fallback_app_menu (void);
|
gboolean meta_prefs_get_show_fallback_app_menu (void);
|
||||||
|
void meta_prefs_set_show_fallback_app_menu (gboolean whether);
|
||||||
|
|
||||||
void meta_prefs_get_button_layout (MetaButtonLayout *button_layout);
|
void meta_prefs_get_button_layout (MetaButtonLayout *button_layout);
|
||||||
|
|
||||||
@@ -384,7 +386,6 @@ typedef enum
|
|||||||
/**
|
/**
|
||||||
* MetaKeyHandlerFunc:
|
* MetaKeyHandlerFunc:
|
||||||
* @display: a #MetaDisplay
|
* @display: a #MetaDisplay
|
||||||
* @screen: a #MetaScreen
|
|
||||||
* @window: a #MetaWindow
|
* @window: a #MetaWindow
|
||||||
* @event: (type gpointer): a #ClutterKeyEvent
|
* @event: (type gpointer): a #ClutterKeyEvent
|
||||||
* @binding: a #MetaKeyBinding
|
* @binding: a #MetaKeyBinding
|
||||||
@@ -392,7 +393,6 @@ typedef enum
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef void (* MetaKeyHandlerFunc) (MetaDisplay *display,
|
typedef void (* MetaKeyHandlerFunc) (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event,
|
ClutterKeyEvent *event,
|
||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
|
|||||||
@@ -1,128 +0,0 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2008 Iain Holmes
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef META_SCREEN_H
|
|
||||||
#define META_SCREEN_H
|
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <glib-object.h>
|
|
||||||
#include <meta/types.h>
|
|
||||||
#include <meta/workspace.h>
|
|
||||||
|
|
||||||
#define META_TYPE_SCREEN (meta_screen_get_type ())
|
|
||||||
#define META_SCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SCREEN, MetaScreen))
|
|
||||||
#define META_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_SCREEN, MetaScreenClass))
|
|
||||||
#define META_IS_SCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_SCREEN))
|
|
||||||
#define META_IS_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_SCREEN))
|
|
||||||
#define META_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_SCREEN, MetaScreenClass))
|
|
||||||
|
|
||||||
typedef struct _MetaScreenClass MetaScreenClass;
|
|
||||||
|
|
||||||
GType meta_screen_get_type (void);
|
|
||||||
|
|
||||||
int meta_screen_get_screen_number (MetaScreen *screen);
|
|
||||||
MetaDisplay *meta_screen_get_display (MetaScreen *screen);
|
|
||||||
|
|
||||||
Window meta_screen_get_xroot (MetaScreen *screen);
|
|
||||||
void meta_screen_get_size (MetaScreen *screen,
|
|
||||||
int *width,
|
|
||||||
int *height);
|
|
||||||
|
|
||||||
void meta_screen_set_cm_selection (MetaScreen *screen);
|
|
||||||
|
|
||||||
GSList *meta_screen_get_startup_sequences (MetaScreen *screen);
|
|
||||||
|
|
||||||
GList *meta_screen_get_workspaces (MetaScreen *screen);
|
|
||||||
|
|
||||||
int meta_screen_get_n_workspaces (MetaScreen *screen);
|
|
||||||
|
|
||||||
MetaWorkspace* meta_screen_get_workspace_by_index (MetaScreen *screen,
|
|
||||||
int index);
|
|
||||||
void meta_screen_remove_workspace (MetaScreen *screen,
|
|
||||||
MetaWorkspace *workspace,
|
|
||||||
guint32 timestamp);
|
|
||||||
|
|
||||||
MetaWorkspace *meta_screen_append_new_workspace (MetaScreen *screen,
|
|
||||||
gboolean activate,
|
|
||||||
guint32 timestamp);
|
|
||||||
|
|
||||||
int meta_screen_get_active_workspace_index (MetaScreen *screen);
|
|
||||||
|
|
||||||
MetaWorkspace * meta_screen_get_active_workspace (MetaScreen *screen);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MetaScreenDirection:
|
|
||||||
* @META_SCREEN_UP: up
|
|
||||||
* @META_SCREEN_DOWN: down
|
|
||||||
* @META_SCREEN_LEFT: left
|
|
||||||
* @META_SCREEN_RIGHT: right
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
META_SCREEN_UP,
|
|
||||||
META_SCREEN_DOWN,
|
|
||||||
META_SCREEN_LEFT,
|
|
||||||
META_SCREEN_RIGHT
|
|
||||||
} MetaScreenDirection;
|
|
||||||
|
|
||||||
int meta_screen_get_n_monitors (MetaScreen *screen);
|
|
||||||
int meta_screen_get_primary_monitor (MetaScreen *screen);
|
|
||||||
int meta_screen_get_current_monitor (MetaScreen *screen);
|
|
||||||
void meta_screen_get_monitor_geometry (MetaScreen *screen,
|
|
||||||
int monitor,
|
|
||||||
MetaRectangle *geometry);
|
|
||||||
|
|
||||||
gboolean meta_screen_get_monitor_in_fullscreen (MetaScreen *screen,
|
|
||||||
int monitor);
|
|
||||||
|
|
||||||
int meta_screen_get_monitor_index_for_rect (MetaScreen *screen,
|
|
||||||
MetaRectangle *rect);
|
|
||||||
|
|
||||||
int meta_screen_get_monitor_neighbor_index (MetaScreen *screen,
|
|
||||||
int which_monitor,
|
|
||||||
MetaScreenDirection dir);
|
|
||||||
|
|
||||||
void meta_screen_focus_default_window (MetaScreen *screen,
|
|
||||||
guint32 timestamp);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MetaScreenCorner:
|
|
||||||
* @META_SCREEN_TOPLEFT: top-left corner
|
|
||||||
* @META_SCREEN_TOPRIGHT: top-right corner
|
|
||||||
* @META_SCREEN_BOTTOMLEFT: bottom-left corner
|
|
||||||
* @META_SCREEN_BOTTOMRIGHT: bottom-right corner
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
META_SCREEN_TOPLEFT,
|
|
||||||
META_SCREEN_TOPRIGHT,
|
|
||||||
META_SCREEN_BOTTOMLEFT,
|
|
||||||
META_SCREEN_BOTTOMRIGHT
|
|
||||||
} MetaScreenCorner;
|
|
||||||
|
|
||||||
void meta_screen_override_workspace_layout (MetaScreen *screen,
|
|
||||||
MetaScreenCorner starting_corner,
|
|
||||||
gboolean vertical_layout,
|
|
||||||
int n_rows,
|
|
||||||
int n_columns);
|
|
||||||
|
|
||||||
void meta_screen_set_cursor (MetaScreen *screen,
|
|
||||||
MetaCursor cursor);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
typedef struct _MetaBackend MetaBackend;
|
typedef struct _MetaBackend MetaBackend;
|
||||||
typedef struct _MetaCompositor MetaCompositor;
|
typedef struct _MetaCompositor MetaCompositor;
|
||||||
typedef struct _MetaDisplay MetaDisplay;
|
typedef struct _MetaDisplay MetaDisplay;
|
||||||
|
typedef struct _MetaX11Display MetaX11Display;
|
||||||
typedef struct _MetaFrame MetaFrame;
|
typedef struct _MetaFrame MetaFrame;
|
||||||
typedef struct _MetaScreen MetaScreen;
|
|
||||||
typedef struct _MetaWindow MetaWindow;
|
typedef struct _MetaWindow MetaWindow;
|
||||||
typedef struct _MetaWorkspace MetaWorkspace;
|
typedef struct _MetaWorkspace MetaWorkspace;
|
||||||
/**
|
/**
|
||||||
@@ -42,4 +42,6 @@ typedef struct _MetaCursorTracker MetaCursorTracker;
|
|||||||
typedef struct _MetaDnd MetaDnd;
|
typedef struct _MetaDnd MetaDnd;
|
||||||
typedef struct _MetaSettings MetaSettings;
|
typedef struct _MetaSettings MetaSettings;
|
||||||
|
|
||||||
|
typedef struct _MetaWorkspaceManager MetaWorkspaceManager;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ void meta_window_frame_rect_to_client_rect (MetaWindow *window,
|
|||||||
MetaRectangle *frame_rect,
|
MetaRectangle *frame_rect,
|
||||||
MetaRectangle *client_rect);
|
MetaRectangle *client_rect);
|
||||||
|
|
||||||
MetaScreen *meta_window_get_screen (MetaWindow *window);
|
|
||||||
MetaDisplay *meta_window_get_display (MetaWindow *window);
|
MetaDisplay *meta_window_get_display (MetaWindow *window);
|
||||||
Window meta_window_get_xwindow (MetaWindow *window);
|
Window meta_window_get_xwindow (MetaWindow *window);
|
||||||
MetaWindowType meta_window_get_window_type (MetaWindow *window);
|
MetaWindowType meta_window_get_window_type (MetaWindow *window);
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
#include <meta/types.h>
|
#include <meta/types.h>
|
||||||
#include <meta/boxes.h>
|
#include <meta/boxes.h>
|
||||||
#include <meta/screen.h>
|
|
||||||
|
|
||||||
#define META_TYPE_WORKSPACE (meta_workspace_get_type ())
|
#define META_TYPE_WORKSPACE (meta_workspace_get_type ())
|
||||||
#define META_WORKSPACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WORKSPACE, MetaWorkspace))
|
#define META_WORKSPACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WORKSPACE, MetaWorkspace))
|
||||||
@@ -37,7 +36,7 @@ typedef struct _MetaWorkspaceClass MetaWorkspaceClass;
|
|||||||
GType meta_workspace_get_type (void);
|
GType meta_workspace_get_type (void);
|
||||||
|
|
||||||
int meta_workspace_index (MetaWorkspace *workspace);
|
int meta_workspace_index (MetaWorkspace *workspace);
|
||||||
MetaScreen *meta_workspace_get_screen (MetaWorkspace *workspace);
|
MetaDisplay *meta_workspace_get_display (MetaWorkspace *workspace);
|
||||||
GList* meta_workspace_list_windows (MetaWorkspace *workspace);
|
GList* meta_workspace_list_windows (MetaWorkspace *workspace);
|
||||||
void meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
|
void meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
|
||||||
int which_monitor,
|
int which_monitor,
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "meta-plugin-manager.h"
|
#include "meta-plugin-manager.h"
|
||||||
#include "wayland/meta-wayland.h"
|
#include "wayland/meta-wayland.h"
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
#define TEST_RUNNER_ERROR test_runner_error_quark ()
|
#define TEST_RUNNER_ERROR test_runner_error_quark ()
|
||||||
|
|
||||||
@@ -60,7 +61,8 @@ async_waiter_new (void)
|
|||||||
{
|
{
|
||||||
AsyncWaiter *waiter = g_new0 (AsyncWaiter, 1);
|
AsyncWaiter *waiter = g_new0 (AsyncWaiter, 1);
|
||||||
|
|
||||||
Display *xdisplay = meta_get_display ()->xdisplay;
|
MetaDisplay *display = meta_get_display ();
|
||||||
|
Display *xdisplay = display->x11_display->xdisplay;
|
||||||
XSyncValue value;
|
XSyncValue value;
|
||||||
XSyncAlarmAttributes attr;
|
XSyncAlarmAttributes attr;
|
||||||
|
|
||||||
@@ -100,7 +102,8 @@ async_waiter_new (void)
|
|||||||
static void
|
static void
|
||||||
async_waiter_destroy (AsyncWaiter *waiter)
|
async_waiter_destroy (AsyncWaiter *waiter)
|
||||||
{
|
{
|
||||||
Display *xdisplay = meta_get_display ()->xdisplay;
|
MetaDisplay *display = meta_get_display ();
|
||||||
|
Display *xdisplay = display->x11_display->xdisplay;
|
||||||
|
|
||||||
XSyncDestroyAlarm (xdisplay, waiter->alarm);
|
XSyncDestroyAlarm (xdisplay, waiter->alarm);
|
||||||
XSyncDestroyCounter (xdisplay, waiter->counter);
|
XSyncDestroyCounter (xdisplay, waiter->counter);
|
||||||
@@ -128,7 +131,8 @@ async_waiter_wait (AsyncWaiter *waiter,
|
|||||||
static void
|
static void
|
||||||
async_waiter_set_and_wait (AsyncWaiter *waiter)
|
async_waiter_set_and_wait (AsyncWaiter *waiter)
|
||||||
{
|
{
|
||||||
Display *xdisplay = meta_get_display ()->xdisplay;
|
MetaDisplay *display = meta_get_display ();
|
||||||
|
Display *xdisplay = display->x11_display->xdisplay;
|
||||||
int wait_value = async_waiter_next_value (waiter);
|
int wait_value = async_waiter_next_value (waiter);
|
||||||
|
|
||||||
XSyncValue sync_value;
|
XSyncValue sync_value;
|
||||||
@@ -140,7 +144,7 @@ async_waiter_set_and_wait (AsyncWaiter *waiter)
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
async_waiter_alarm_filter (AsyncWaiter *waiter,
|
async_waiter_alarm_filter (AsyncWaiter *waiter,
|
||||||
MetaDisplay *display,
|
MetaX11Display *x11_display,
|
||||||
XSyncAlarmNotifyEvent *event)
|
XSyncAlarmNotifyEvent *event)
|
||||||
{
|
{
|
||||||
if (event->alarm != waiter->alarm)
|
if (event->alarm != waiter->alarm)
|
||||||
@@ -396,11 +400,11 @@ test_client_find_window (TestClient *client,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
test_client_alarm_filter (TestClient *client,
|
test_client_alarm_filter (TestClient *client,
|
||||||
MetaDisplay *display,
|
MetaX11Display *x11_display,
|
||||||
XSyncAlarmNotifyEvent *event)
|
XSyncAlarmNotifyEvent *event)
|
||||||
{
|
{
|
||||||
if (client->waiter)
|
if (client->waiter)
|
||||||
return async_waiter_alarm_filter (client->waiter, display, event);
|
return async_waiter_alarm_filter (client->waiter, x11_display, event);
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -416,7 +420,7 @@ typedef struct {
|
|||||||
} TestCase;
|
} TestCase;
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
test_case_alarm_filter (MetaDisplay *display,
|
test_case_alarm_filter (MetaX11Display *x11_display,
|
||||||
XSyncAlarmNotifyEvent *event,
|
XSyncAlarmNotifyEvent *event,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
@@ -424,12 +428,12 @@ test_case_alarm_filter (MetaDisplay *display,
|
|||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
gpointer key, value;
|
gpointer key, value;
|
||||||
|
|
||||||
if (async_waiter_alarm_filter (test->waiter, display, event))
|
if (async_waiter_alarm_filter (test->waiter, x11_display, event))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
g_hash_table_iter_init (&iter, test->clients);
|
g_hash_table_iter_init (&iter, test->clients);
|
||||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||||
if (test_client_alarm_filter (value, display, event))
|
if (test_client_alarm_filter (value, x11_display, event))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -478,8 +482,8 @@ test_case_new (void)
|
|||||||
test_case_log_func,
|
test_case_log_func,
|
||||||
test);
|
test);
|
||||||
|
|
||||||
meta_display_set_alarm_filter (meta_get_display (),
|
meta_x11_display_set_alarm_filter (meta_get_display ()->x11_display,
|
||||||
test_case_alarm_filter, test);
|
test_case_alarm_filter, test);
|
||||||
|
|
||||||
test->clients = g_hash_table_new (g_str_hash, g_str_equal);
|
test->clients = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
test->waiter = async_waiter_new ();
|
test->waiter = async_waiter_new ();
|
||||||
@@ -588,7 +592,7 @@ test_case_assert_stacking (TestCase *test,
|
|||||||
GString *expected_string = g_string_new (NULL);
|
GString *expected_string = g_string_new (NULL);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
meta_stack_tracker_get_stack (display->screen->stack_tracker, &windows, &n_windows);
|
meta_stack_tracker_get_stack (display->stack_tracker, &windows, &n_windows);
|
||||||
for (i = 0; i < n_windows; i++)
|
for (i = 0; i < n_windows; i++)
|
||||||
{
|
{
|
||||||
MetaWindow *window = meta_display_lookup_stack_id (display, windows[i]);
|
MetaWindow *window = meta_display_lookup_stack_id (display, windows[i]);
|
||||||
@@ -598,7 +602,7 @@ test_case_assert_stacking (TestCase *test,
|
|||||||
* is managed as a MetaWindow.
|
* is managed as a MetaWindow.
|
||||||
*/
|
*/
|
||||||
if (META_STACK_ID_IS_X11 (windows[i]) &&
|
if (META_STACK_ID_IS_X11 (windows[i]) &&
|
||||||
meta_ui_window_is_dummy (display->screen->ui, windows[i]))
|
meta_ui_window_is_dummy (display->x11_display->ui, windows[i]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (stack_string->len > 0)
|
if (stack_string->len > 0)
|
||||||
@@ -609,7 +613,7 @@ test_case_assert_stacking (TestCase *test,
|
|||||||
else
|
else
|
||||||
g_string_append_printf (stack_string, "(%s)", window->title);
|
g_string_append_printf (stack_string, "(%s)", window->title);
|
||||||
}
|
}
|
||||||
else if (windows[i] == display->screen->guard_window)
|
else if (windows[i] == display->x11_display->guard_window)
|
||||||
{
|
{
|
||||||
if (stack_string->len > 0)
|
if (stack_string->len > 0)
|
||||||
g_string_append_c (stack_string, ' ');
|
g_string_append_c (stack_string, ' ');
|
||||||
@@ -660,7 +664,7 @@ test_case_check_xserver_stacking (TestCase *test,
|
|||||||
|
|
||||||
guint64 *windows;
|
guint64 *windows;
|
||||||
int n_windows;
|
int n_windows;
|
||||||
meta_stack_tracker_get_stack (display->screen->stack_tracker, &windows, &n_windows);
|
meta_stack_tracker_get_stack (display->stack_tracker, &windows, &n_windows);
|
||||||
|
|
||||||
for (i = 0; i < n_windows; i++)
|
for (i = 0; i < n_windows; i++)
|
||||||
{
|
{
|
||||||
@@ -677,8 +681,8 @@ test_case_check_xserver_stacking (TestCase *test,
|
|||||||
Window parent;
|
Window parent;
|
||||||
Window *children;
|
Window *children;
|
||||||
unsigned int n_children;
|
unsigned int n_children;
|
||||||
XQueryTree (display->xdisplay,
|
XQueryTree (display->x11_display->xdisplay,
|
||||||
meta_screen_get_xroot (display->screen),
|
display->x11_display->xroot,
|
||||||
&root, &parent, &children, &n_children);
|
&root, &parent, &children, &n_children);
|
||||||
|
|
||||||
for (i = 0; i < (int)n_children; i++)
|
for (i = 0; i < (int)n_children; i++)
|
||||||
@@ -878,7 +882,8 @@ test_case_destroy (TestCase *test,
|
|||||||
|
|
||||||
async_waiter_destroy (test->waiter);
|
async_waiter_destroy (test->waiter);
|
||||||
|
|
||||||
meta_display_set_alarm_filter (meta_get_display (), NULL, NULL);
|
meta_x11_display_set_alarm_filter (meta_get_display ()->x11_display,
|
||||||
|
NULL, NULL);
|
||||||
|
|
||||||
g_hash_table_destroy (test->clients);
|
g_hash_table_destroy (test->clients);
|
||||||
g_free (test);
|
g_free (test);
|
||||||
|
|||||||
59
src/ui/ui.c
59
src/ui/ui.c
@@ -26,6 +26,7 @@
|
|||||||
#include <meta/util.h>
|
#include <meta/util.h>
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
#include "theme-private.h"
|
#include "theme-private.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -44,52 +45,18 @@ struct _MetaUI
|
|||||||
guint32 button_click_time;
|
guint32 button_click_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
MetaUI *
|
||||||
meta_ui_init (void)
|
meta_ui_new (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
const char *gdk_gl_env = NULL;
|
|
||||||
gdk_set_allowed_backends ("x11");
|
|
||||||
|
|
||||||
gdk_gl_env = g_getenv ("GDK_GL");
|
|
||||||
g_setenv("GDK_GL", "disable", TRUE);
|
|
||||||
|
|
||||||
if (!gtk_init_check (NULL, NULL))
|
|
||||||
meta_fatal ("Unable to open X display %s\n", XDisplayName (NULL));
|
|
||||||
|
|
||||||
if (gdk_gl_env)
|
|
||||||
g_setenv("GDK_GL", gdk_gl_env, TRUE);
|
|
||||||
else
|
|
||||||
unsetenv("GDK_GL");
|
|
||||||
|
|
||||||
/* We need to be able to fully trust that the window and monitor sizes
|
|
||||||
that Gdk reports corresponds to the X ones, so we disable the automatic
|
|
||||||
scale handling */
|
|
||||||
gdk_x11_display_set_window_scale (gdk_display_get_default (), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Display*
|
|
||||||
meta_ui_get_display (void)
|
|
||||||
{
|
|
||||||
return GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
|
||||||
}
|
|
||||||
|
|
||||||
gint
|
|
||||||
meta_ui_get_screen_number (void)
|
|
||||||
{
|
|
||||||
return gdk_screen_get_number (gdk_screen_get_default ());
|
|
||||||
}
|
|
||||||
|
|
||||||
MetaUI*
|
|
||||||
meta_ui_new (Display *xdisplay)
|
|
||||||
{
|
|
||||||
GdkDisplay *gdisplay;
|
|
||||||
MetaUI *ui;
|
MetaUI *ui;
|
||||||
|
|
||||||
ui = g_new0 (MetaUI, 1);
|
if (!gtk_init_check (NULL, NULL))
|
||||||
ui->xdisplay = xdisplay;
|
meta_fatal ("Unable to initialize GTK");
|
||||||
|
|
||||||
gdisplay = gdk_x11_lookup_xdisplay (xdisplay);
|
g_assert (x11_display->gdk_display == gdk_display_get_default ());
|
||||||
g_assert (gdisplay == gdk_display_get_default ());
|
|
||||||
|
ui = g_new0 (MetaUI, 1);
|
||||||
|
ui->xdisplay = x11_display->xdisplay;
|
||||||
|
|
||||||
ui->frames = meta_frames_new ();
|
ui->frames = meta_frames_new ();
|
||||||
/* GTK+ needs the frame-sync protocol to work in order to properly
|
/* GTK+ needs the frame-sync protocol to work in order to properly
|
||||||
@@ -100,7 +67,7 @@ meta_ui_new (Display *xdisplay)
|
|||||||
*/
|
*/
|
||||||
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 (x11_display->gdk_display), "meta-ui", ui);
|
||||||
|
|
||||||
return ui;
|
return ui;
|
||||||
}
|
}
|
||||||
@@ -108,12 +75,12 @@ meta_ui_new (Display *xdisplay)
|
|||||||
void
|
void
|
||||||
meta_ui_free (MetaUI *ui)
|
meta_ui_free (MetaUI *ui)
|
||||||
{
|
{
|
||||||
GdkDisplay *gdisplay;
|
GdkDisplay *gdk_display;
|
||||||
|
|
||||||
gtk_widget_destroy (GTK_WIDGET (ui->frames));
|
gtk_widget_destroy (GTK_WIDGET (ui->frames));
|
||||||
|
|
||||||
gdisplay = gdk_x11_lookup_xdisplay (ui->xdisplay);
|
gdk_display = gdk_x11_lookup_xdisplay (ui->xdisplay);
|
||||||
g_object_set_data (G_OBJECT (gdisplay), "meta-ui", NULL);
|
g_object_set_data (G_OBJECT (gdk_display), "meta-ui", NULL);
|
||||||
|
|
||||||
g_free (ui);
|
g_free (ui);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,13 +36,7 @@ typedef struct _MetaUIFrame MetaUIFrame;
|
|||||||
|
|
||||||
typedef gboolean (* MetaEventFunc) (XEvent *xevent, gpointer data);
|
typedef gboolean (* MetaEventFunc) (XEvent *xevent, gpointer data);
|
||||||
|
|
||||||
void meta_ui_init (void);
|
MetaUI *meta_ui_new (MetaX11Display *x11_display);
|
||||||
|
|
||||||
Display* meta_ui_get_display (void);
|
|
||||||
|
|
||||||
gint meta_ui_get_screen_number (void);
|
|
||||||
|
|
||||||
MetaUI* meta_ui_new (Display *xdisplay);
|
|
||||||
void meta_ui_free (MetaUI *ui);
|
void meta_ui_free (MetaUI *ui);
|
||||||
|
|
||||||
void meta_ui_theme_get_frame_borders (MetaUI *ui,
|
void meta_ui_theme_get_frame_borders (MetaUI *ui,
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ meta_wayland_popup_grab_begin (MetaWaylandPopupGrab *grab,
|
|||||||
|
|
||||||
meta_wayland_pointer_start_grab (pointer, (MetaWaylandPointerGrab*)grab);
|
meta_wayland_pointer_start_grab (pointer, (MetaWaylandPointerGrab*)grab);
|
||||||
meta_display_begin_grab_op (window->display,
|
meta_display_begin_grab_op (window->display,
|
||||||
window->screen,
|
|
||||||
window,
|
window,
|
||||||
META_GRAB_OP_WAYLAND_POPUP,
|
META_GRAB_OP_WAYLAND_POPUP,
|
||||||
FALSE, /* pointer_already_grabbed */
|
FALSE, /* pointer_already_grabbed */
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include "meta-wayland-surface-role-cursor.h"
|
#include "meta-wayland-surface-role-cursor.h"
|
||||||
#include "meta-wayland-buffer.h"
|
#include "meta-wayland-buffer.h"
|
||||||
#include "meta-xwayland.h"
|
#include "meta-xwayland.h"
|
||||||
#include "screen-private.h"
|
|
||||||
#include "meta-wayland-private.h"
|
#include "meta-wayland-private.h"
|
||||||
#include "backends/meta-backend-private.h"
|
#include "backends/meta-backend-private.h"
|
||||||
#include "backends/meta-logical-monitor.h"
|
#include "backends/meta-logical-monitor.h"
|
||||||
|
|||||||
@@ -1410,7 +1410,6 @@ meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
|
|||||||
constrain it in the same way as it would be if the window was
|
constrain it in the same way as it would be if the window was
|
||||||
being moved/resized via a SSD event. */
|
being moved/resized via a SSD event. */
|
||||||
return meta_display_begin_grab_op (window->display,
|
return meta_display_begin_grab_op (window->display,
|
||||||
window->screen,
|
|
||||||
window,
|
window,
|
||||||
grab_op,
|
grab_op,
|
||||||
TRUE, /* pointer_already_grabbed */
|
TRUE, /* pointer_already_grabbed */
|
||||||
|
|||||||
@@ -45,6 +45,8 @@
|
|||||||
#include "meta-wayland-inhibit-shortcuts.h"
|
#include "meta-wayland-inhibit-shortcuts.h"
|
||||||
#include "meta-wayland-inhibit-shortcuts-dialog.h"
|
#include "meta-wayland-inhibit-shortcuts-dialog.h"
|
||||||
|
|
||||||
|
#include "main-private.h"
|
||||||
|
|
||||||
static MetaWaylandCompositor _meta_wayland_compositor;
|
static MetaWaylandCompositor _meta_wayland_compositor;
|
||||||
static char *_display_name_override;
|
static char *_display_name_override;
|
||||||
|
|
||||||
@@ -362,7 +364,8 @@ meta_wayland_init (void)
|
|||||||
meta_wayland_keyboard_shortcuts_inhibit_init (compositor);
|
meta_wayland_keyboard_shortcuts_inhibit_init (compositor);
|
||||||
meta_wayland_surface_inhibit_shortcuts_dialog_init ();
|
meta_wayland_surface_inhibit_shortcuts_dialog_init ();
|
||||||
|
|
||||||
if (!meta_xwayland_start (&compositor->xwayland_manager, compositor->wayland_display))
|
if (meta_should_autostart_x11_display () &&
|
||||||
|
!meta_xwayland_start (&compositor->xwayland_manager, compositor->wayland_display))
|
||||||
g_error ("Failed to start X Wayland");
|
g_error ("Failed to start X Wayland");
|
||||||
|
|
||||||
if (_display_name_override)
|
if (_display_name_override)
|
||||||
@@ -383,7 +386,9 @@ meta_wayland_init (void)
|
|||||||
g_error ("Failed to create socket");
|
g_error ("Failed to create socket");
|
||||||
}
|
}
|
||||||
|
|
||||||
set_gnome_env ("DISPLAY", meta_wayland_get_xwayland_display_name (compositor));
|
if (meta_should_autostart_x11_display ())
|
||||||
|
set_gnome_env ("DISPLAY", meta_wayland_get_xwayland_display_name (compositor));
|
||||||
|
|
||||||
set_gnome_env ("WAYLAND_DISPLAY", meta_wayland_get_wayland_display_name (compositor));
|
set_gnome_env ("WAYLAND_DISPLAY", meta_wayland_get_wayland_display_name (compositor));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "meta-window-wayland.h"
|
#include "meta-window-wayland.h"
|
||||||
|
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h> /* for strerror () */
|
#include <string.h> /* for strerror () */
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
@@ -85,7 +85,7 @@ meta_window_wayland_manage (MetaWindow *window)
|
|||||||
meta_display_register_wayland_window (display, window);
|
meta_display_register_wayland_window (display, window);
|
||||||
|
|
||||||
{
|
{
|
||||||
meta_stack_tracker_record_add (window->screen->stack_tracker,
|
meta_stack_tracker_record_add (window->display->stack_tracker,
|
||||||
window->stamp,
|
window->stamp,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
@@ -97,7 +97,7 @@ static void
|
|||||||
meta_window_wayland_unmanage (MetaWindow *window)
|
meta_window_wayland_unmanage (MetaWindow *window)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
meta_stack_tracker_record_remove (window->screen->stack_tracker,
|
meta_stack_tracker_record_remove (window->display->stack_tracker,
|
||||||
window->stamp,
|
window->stamp,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
@@ -136,10 +136,10 @@ meta_window_wayland_focus (MetaWindow *window,
|
|||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
if (window->input)
|
if (window->input)
|
||||||
meta_display_set_input_focus_window (window->display,
|
meta_x11_display_set_input_focus_window (window->display->x11_display,
|
||||||
window,
|
window,
|
||||||
FALSE,
|
FALSE,
|
||||||
timestamp);
|
timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -564,7 +564,6 @@ meta_window_wayland_new (MetaDisplay *display,
|
|||||||
MetaWaylandSurface *surface)
|
MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
XWindowAttributes attrs = { 0 };
|
XWindowAttributes attrs = { 0 };
|
||||||
MetaScreen *scr = display->screen;
|
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -585,12 +584,11 @@ meta_window_wayland_new (MetaDisplay *display,
|
|||||||
* X requests (passing a window xid of None) until we thoroughly audit all
|
* X requests (passing a window xid of None) until we thoroughly audit all
|
||||||
* the code to make sure it knows about non X based clients...
|
* the code to make sure it knows about non X based clients...
|
||||||
*/
|
*/
|
||||||
meta_error_trap_push (display); /* Push a trap over all of window
|
meta_x11_error_trap_push (display->x11_display); /* Push a trap over all of window
|
||||||
* creation, to reduce XSync() calls
|
* creation, to reduce XSync() calls
|
||||||
*/
|
*/
|
||||||
|
|
||||||
window = _meta_window_shared_new (display,
|
window = _meta_window_shared_new (display,
|
||||||
scr,
|
|
||||||
META_WINDOW_CLIENT_TYPE_WAYLAND,
|
META_WINDOW_CLIENT_TYPE_WAYLAND,
|
||||||
surface,
|
surface,
|
||||||
None,
|
None,
|
||||||
@@ -599,7 +597,7 @@ meta_window_wayland_new (MetaDisplay *display,
|
|||||||
&attrs);
|
&attrs);
|
||||||
window->can_ping = TRUE;
|
window->can_ping = TRUE;
|
||||||
|
|
||||||
meta_error_trap_pop (display); /* pop the XSync()-reducing trap */
|
meta_x11_error_trap_pop (display->x11_display); /* pop the XSync()-reducing trap */
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,11 +34,12 @@
|
|||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/extensions/Xfixes.h>
|
#include <X11/extensions/Xfixes.h>
|
||||||
|
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "meta-xwayland.h"
|
#include "meta-xwayland.h"
|
||||||
#include "meta-xwayland-private.h"
|
#include "meta-xwayland-private.h"
|
||||||
#include "meta-xwayland-selection-private.h"
|
#include "meta-xwayland-selection-private.h"
|
||||||
#include "meta-wayland-data-device.h"
|
#include "meta-wayland-data-device.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
#define INCR_CHUNK_SIZE (128 * 1024)
|
#define INCR_CHUNK_SIZE (128 * 1024)
|
||||||
#define XDND_VERSION 5
|
#define XDND_VERSION 5
|
||||||
@@ -466,7 +467,7 @@ x11_selection_data_send_finished (MetaSelectionBridge *selection,
|
|||||||
gdk_x11_get_xatom_by_name ("DELETE"),
|
gdk_x11_get_xatom_by_name ("DELETE"),
|
||||||
gdk_x11_get_xatom_by_name ("_META_SELECTION"),
|
gdk_x11_get_xatom_by_name ("_META_SELECTION"),
|
||||||
selection->window,
|
selection->window,
|
||||||
CurrentTime);
|
META_CURRENT_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
xdnd_send_finished (selection->x11_selection->selection_data,
|
xdnd_send_finished (selection->x11_selection->selection_data,
|
||||||
@@ -562,7 +563,7 @@ wayland_selection_data_new (XSelectionRequestEvent *request_event,
|
|||||||
MetaWaylandCompositor *compositor)
|
MetaWaylandCompositor *compositor)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_get_display ();
|
MetaDisplay *display = meta_get_display ();
|
||||||
MetaScreen *screen = display->screen;
|
MetaX11Display *x11_display = display->x11_display;
|
||||||
MetaWaylandDataDevice *data_device;
|
MetaWaylandDataDevice *data_device;
|
||||||
MetaWaylandDataSource *wayland_source;
|
MetaWaylandDataSource *wayland_source;
|
||||||
MetaSelectionBridge *selection;
|
MetaSelectionBridge *selection;
|
||||||
@@ -609,11 +610,11 @@ wayland_selection_data_new (XSelectionRequestEvent *request_event,
|
|||||||
data->cancellable = g_cancellable_new ();
|
data->cancellable = g_cancellable_new ();
|
||||||
data->stream = g_unix_input_stream_new (p[0], TRUE);
|
data->stream = g_unix_input_stream_new (p[0], TRUE);
|
||||||
|
|
||||||
data->window = meta_display_lookup_x_window (meta_get_display (),
|
data->window = meta_x11_display_lookup_x_window (x11_display,
|
||||||
data->request_event.requestor);
|
data->request_event.requestor);
|
||||||
|
|
||||||
/* Do *not* change the event mask on the root window, bugger! */
|
/* Do *not* change the event mask on the root window, bugger! */
|
||||||
if (!data->window && data->request_event.requestor != screen->xroot)
|
if (!data->window && data->request_event.requestor != x11_display->xroot)
|
||||||
{
|
{
|
||||||
/* Not a managed window, set the PropertyChangeMask
|
/* Not a managed window, set the PropertyChangeMask
|
||||||
* for INCR deletion notifications.
|
* for INCR deletion notifications.
|
||||||
@@ -648,15 +649,15 @@ static void
|
|||||||
wayland_selection_data_free (WaylandSelectionData *data)
|
wayland_selection_data_free (WaylandSelectionData *data)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_get_display ();
|
MetaDisplay *display = meta_get_display ();
|
||||||
MetaScreen *screen = display->screen;
|
MetaX11Display *x11_display = display->x11_display;
|
||||||
|
|
||||||
/* Do *not* change the event mask on the root window, bugger! */
|
/* Do *not* change the event mask on the root window, bugger! */
|
||||||
if (!data->window && data->request_event.requestor != screen->xroot)
|
if (!data->window && data->request_event.requestor != x11_display->xroot)
|
||||||
{
|
{
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
||||||
data->request_event.requestor, NoEventMask);
|
data->request_event.requestor, NoEventMask);
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_cancellable_cancel (data->cancellable);
|
g_cancellable_cancel (data->cancellable);
|
||||||
@@ -1344,7 +1345,7 @@ pick_drop_surface (MetaWaylandCompositor *compositor,
|
|||||||
ClutterPoint pos;
|
ClutterPoint pos;
|
||||||
|
|
||||||
clutter_event_get_coords (event, &pos.x, &pos.y);
|
clutter_event_get_coords (event, &pos.x, &pos.y);
|
||||||
focus_window = meta_stack_get_default_focus_window_at_point (display->screen->stack,
|
focus_window = meta_stack_get_default_focus_window_at_point (display->stack,
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
pos.x, pos.y);
|
pos.x, pos.y);
|
||||||
return focus_window ? focus_window->surface : NULL;
|
return focus_window ? focus_window->surface : NULL;
|
||||||
@@ -1616,7 +1617,7 @@ meta_xwayland_selection_handle_xfixes_selection_notify (MetaWaylandCompositor *c
|
|||||||
gdk_x11_get_xatom_by_name ("TARGETS"),
|
gdk_x11_get_xatom_by_name ("TARGETS"),
|
||||||
gdk_x11_get_xatom_by_name ("_META_SELECTION"),
|
gdk_x11_get_xatom_by_name ("_META_SELECTION"),
|
||||||
selection->window,
|
selection->window,
|
||||||
CurrentTime);
|
META_CURRENT_TIME);
|
||||||
XFlush (xdisplay);
|
XFlush (xdisplay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1631,7 +1632,7 @@ meta_xwayland_selection_handle_xfixes_selection_notify (MetaWaylandCompositor *c
|
|||||||
if (event->owner != None && event->owner != selection->window &&
|
if (event->owner != None && event->owner != selection->window &&
|
||||||
focus && meta_xwayland_is_xwayland_surface (focus))
|
focus && meta_xwayland_is_xwayland_surface (focus))
|
||||||
{
|
{
|
||||||
selection->client_message_timestamp = CurrentTime;
|
selection->client_message_timestamp = META_CURRENT_TIME;
|
||||||
selection->source = meta_wayland_data_source_xwayland_new (selection);
|
selection->source = meta_wayland_data_source_xwayland_new (selection);
|
||||||
meta_wayland_data_device_set_dnd_source (&compositor->seat->data_device,
|
meta_wayland_data_device_set_dnd_source (&compositor->seat->data_device,
|
||||||
selection->source);
|
selection->source);
|
||||||
@@ -1673,9 +1674,9 @@ meta_xwayland_selection_handle_event (XEvent *xevent)
|
|||||||
return meta_xwayland_selection_handle_client_message (compositor, xevent);
|
return meta_xwayland_selection_handle_client_message (compositor, xevent);
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_get_display ();
|
MetaX11Display *x11_display = meta_get_display ()->x11_display;
|
||||||
|
|
||||||
if (xevent->type - display->xfixes_event_base == XFixesSelectionNotify)
|
if (xevent->type - x11_display->xfixes_event_base == XFixesSelectionNotify)
|
||||||
return meta_xwayland_selection_handle_xfixes_selection_notify (compositor, xevent);
|
return meta_xwayland_selection_handle_xfixes_selection_notify (compositor, xevent);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -1702,7 +1703,7 @@ meta_selection_bridge_ownership_notify (struct wl_listener *listener,
|
|||||||
XSetSelectionOwner (xdisplay,
|
XSetSelectionOwner (xdisplay,
|
||||||
selection->selection_atom,
|
selection->selection_atom,
|
||||||
selection->window,
|
selection->window,
|
||||||
CurrentTime);
|
META_CURRENT_TIME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
471
src/x11/events.c
471
src/x11/events.c
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@
|
|||||||
#ifndef META_EVENTS_X11_H
|
#ifndef META_EVENTS_X11_H
|
||||||
#define META_EVENTS_X11_H
|
#define META_EVENTS_X11_H
|
||||||
|
|
||||||
void meta_display_init_events_x11 (MetaDisplay *display);
|
void meta_x11_display_init_events (MetaX11Display *x11_display);
|
||||||
void meta_display_free_events_x11 (MetaDisplay *display);
|
void meta_x11_display_free_events (MetaX11Display *x11_display);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
struct _MetaGroup
|
struct _MetaGroup
|
||||||
{
|
{
|
||||||
int refcount;
|
int refcount;
|
||||||
MetaDisplay *display;
|
MetaX11Display *x11_display;
|
||||||
GSList *windows;
|
GSList *windows;
|
||||||
Window group_leader;
|
Window group_leader;
|
||||||
char *startup_id;
|
char *startup_id;
|
||||||
|
|||||||
@@ -23,13 +23,14 @@
|
|||||||
#include "group-props.h"
|
#include "group-props.h"
|
||||||
#include "group-private.h"
|
#include "group-private.h"
|
||||||
#include "xprops.h"
|
#include "xprops.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
|
||||||
typedef void (* InitValueFunc) (MetaDisplay *display,
|
typedef void (* InitValueFunc) (MetaX11Display *x11_display,
|
||||||
Atom property,
|
Atom property,
|
||||||
MetaPropValue *value);
|
MetaPropValue *value);
|
||||||
typedef void (* ReloadValueFunc) (MetaGroup *group,
|
typedef void (* ReloadValueFunc) (MetaGroup *group,
|
||||||
MetaPropValue *value);
|
MetaPropValue *value);
|
||||||
|
|
||||||
struct _MetaGroupPropHooks
|
struct _MetaGroupPropHooks
|
||||||
{
|
{
|
||||||
@@ -38,15 +39,13 @@ struct _MetaGroupPropHooks
|
|||||||
ReloadValueFunc reload_func;
|
ReloadValueFunc reload_func;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void init_prop_value (MetaDisplay *display,
|
static void init_prop_value (MetaX11Display *x11_display,
|
||||||
Atom property,
|
Atom property,
|
||||||
MetaPropValue *value);
|
MetaPropValue *value);
|
||||||
static void reload_prop_value (MetaGroup *group,
|
static void reload_prop_value (MetaGroup *group,
|
||||||
MetaPropValue *value);
|
MetaPropValue *value);
|
||||||
static MetaGroupPropHooks* find_hooks (MetaDisplay *display,
|
static MetaGroupPropHooks *find_hooks (MetaX11Display *x11_display,
|
||||||
Atom property);
|
Atom property);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_group_reload_property (MetaGroup *group,
|
meta_group_reload_property (MetaGroup *group,
|
||||||
@@ -71,11 +70,12 @@ meta_group_reload_properties (MetaGroup *group,
|
|||||||
i = 0;
|
i = 0;
|
||||||
while (i < n_properties)
|
while (i < n_properties)
|
||||||
{
|
{
|
||||||
init_prop_value (group->display, properties[i], &values[i]);
|
init_prop_value (group->x11_display, properties[i], &values[i]);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_prop_get_values (group->display, group->group_leader,
|
meta_prop_get_values (group->x11_display,
|
||||||
|
group->group_leader,
|
||||||
values, n_properties);
|
values, n_properties);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
@@ -93,18 +93,18 @@ meta_group_reload_properties (MetaGroup *group,
|
|||||||
|
|
||||||
/* Fill in the MetaPropValue used to get the value of "property" */
|
/* Fill in the MetaPropValue used to get the value of "property" */
|
||||||
static void
|
static void
|
||||||
init_prop_value (MetaDisplay *display,
|
init_prop_value (MetaX11Display *x11_display,
|
||||||
Atom property,
|
Atom property,
|
||||||
MetaPropValue *value)
|
MetaPropValue *value)
|
||||||
{
|
{
|
||||||
MetaGroupPropHooks *hooks;
|
MetaGroupPropHooks *hooks;
|
||||||
|
|
||||||
value->type = META_PROP_VALUE_INVALID;
|
value->type = META_PROP_VALUE_INVALID;
|
||||||
value->atom = None;
|
value->atom = None;
|
||||||
|
|
||||||
hooks = find_hooks (display, property);
|
hooks = find_hooks (x11_display, property);
|
||||||
if (hooks && hooks->init_func != NULL)
|
if (hooks && hooks->init_func != NULL)
|
||||||
(* hooks->init_func) (display, property, value);
|
(* hooks->init_func) (x11_display, property, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -113,18 +113,18 @@ reload_prop_value (MetaGroup *group,
|
|||||||
{
|
{
|
||||||
MetaGroupPropHooks *hooks;
|
MetaGroupPropHooks *hooks;
|
||||||
|
|
||||||
hooks = find_hooks (group->display, value->atom);
|
hooks = find_hooks (group->x11_display, value->atom);
|
||||||
if (hooks && hooks->reload_func != NULL)
|
if (hooks && hooks->reload_func != NULL)
|
||||||
(* hooks->reload_func) (group, value);
|
(* hooks->reload_func) (group, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_wm_client_machine (MetaDisplay *display,
|
init_wm_client_machine (MetaX11Display *x11_display,
|
||||||
Atom property,
|
Atom property,
|
||||||
MetaPropValue *value)
|
MetaPropValue *value)
|
||||||
{
|
{
|
||||||
value->type = META_PROP_VALUE_STRING;
|
value->type = META_PROP_VALUE_STRING;
|
||||||
value->atom = display->atom_WM_CLIENT_MACHINE;
|
value->atom = x11_display->atom_WM_CLIENT_MACHINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -142,12 +142,12 @@ reload_wm_client_machine (MetaGroup *group,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_net_startup_id (MetaDisplay *display,
|
init_net_startup_id (MetaX11Display *x11_display,
|
||||||
Atom property,
|
Atom property,
|
||||||
MetaPropValue *value)
|
MetaPropValue *value)
|
||||||
{
|
{
|
||||||
value->type = META_PROP_VALUE_UTF8;
|
value->type = META_PROP_VALUE_UTF8;
|
||||||
value->atom = display->atom__NET_STARTUP_ID;
|
value->atom = x11_display->atom__NET_STARTUP_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -167,29 +167,29 @@ reload_net_startup_id (MetaGroup *group,
|
|||||||
#define N_HOOKS 3
|
#define N_HOOKS 3
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_display_init_group_prop_hooks (MetaDisplay *display)
|
meta_x11_display_init_group_prop_hooks (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
MetaGroupPropHooks *hooks;
|
MetaGroupPropHooks *hooks;
|
||||||
|
|
||||||
g_assert (display->group_prop_hooks == NULL);
|
g_assert (x11_display->group_prop_hooks == NULL);
|
||||||
|
|
||||||
display->group_prop_hooks = g_new0 (MetaGroupPropHooks, N_HOOKS);
|
x11_display->group_prop_hooks = g_new0 (MetaGroupPropHooks, N_HOOKS);
|
||||||
hooks = display->group_prop_hooks;
|
hooks = x11_display->group_prop_hooks;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
hooks[i].property = display->atom_WM_CLIENT_MACHINE;
|
hooks[i].property = x11_display->atom_WM_CLIENT_MACHINE;
|
||||||
hooks[i].init_func = init_wm_client_machine;
|
hooks[i].init_func = init_wm_client_machine;
|
||||||
hooks[i].reload_func = reload_wm_client_machine;
|
hooks[i].reload_func = reload_wm_client_machine;
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
hooks[i].property = display->atom__NET_WM_PID;
|
hooks[i].property = x11_display->atom__NET_WM_PID;
|
||||||
hooks[i].init_func = NULL;
|
hooks[i].init_func = NULL;
|
||||||
hooks[i].reload_func = NULL;
|
hooks[i].reload_func = NULL;
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
hooks[i].property = display->atom__NET_STARTUP_ID;
|
hooks[i].property = x11_display->atom__NET_STARTUP_ID;
|
||||||
hooks[i].init_func = init_net_startup_id;
|
hooks[i].init_func = init_net_startup_id;
|
||||||
hooks[i].reload_func = reload_net_startup_id;
|
hooks[i].reload_func = reload_net_startup_id;
|
||||||
++i;
|
++i;
|
||||||
@@ -201,17 +201,17 @@ meta_display_init_group_prop_hooks (MetaDisplay *display)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_display_free_group_prop_hooks (MetaDisplay *display)
|
meta_x11_display_free_group_prop_hooks (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
g_assert (display->group_prop_hooks != NULL);
|
g_assert (x11_display->group_prop_hooks != NULL);
|
||||||
|
|
||||||
g_free (display->group_prop_hooks);
|
g_free (x11_display->group_prop_hooks);
|
||||||
display->group_prop_hooks = NULL;
|
x11_display->group_prop_hooks = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static MetaGroupPropHooks*
|
static MetaGroupPropHooks*
|
||||||
find_hooks (MetaDisplay *display,
|
find_hooks (MetaX11Display *x11_display,
|
||||||
Atom property)
|
Atom property)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -222,8 +222,8 @@ find_hooks (MetaDisplay *display,
|
|||||||
i = 0;
|
i = 0;
|
||||||
while (i < N_HOOKS)
|
while (i < N_HOOKS)
|
||||||
{
|
{
|
||||||
if (display->group_prop_hooks[i].property == property)
|
if (x11_display->group_prop_hooks[i].property == property)
|
||||||
return &display->group_prop_hooks[i];
|
return &x11_display->group_prop_hooks[i];
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ void meta_group_reload_property (MetaGroup *group,
|
|||||||
void meta_group_reload_properties (MetaGroup *group,
|
void meta_group_reload_properties (MetaGroup *group,
|
||||||
const Atom *properties,
|
const Atom *properties,
|
||||||
int n_properties);
|
int n_properties);
|
||||||
void meta_display_init_group_prop_hooks (MetaDisplay *display);
|
|
||||||
void meta_display_free_group_prop_hooks (MetaDisplay *display);
|
void meta_x11_display_init_group_prop_hooks (MetaX11Display *x11_display);
|
||||||
|
void meta_x11_display_free_group_prop_hooks (MetaX11Display *x11_display);
|
||||||
|
|
||||||
#endif /* META_GROUP_PROPS_H */
|
#endif /* META_GROUP_PROPS_H */
|
||||||
|
|||||||
@@ -30,12 +30,13 @@
|
|||||||
#include "group-private.h"
|
#include "group-private.h"
|
||||||
#include "group-props.h"
|
#include "group-props.h"
|
||||||
#include "window-private.h"
|
#include "window-private.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
#include <meta/window.h>
|
#include <meta/window.h>
|
||||||
#include <X11/Xlib-xcb.h>
|
#include <X11/Xlib-xcb.h>
|
||||||
|
|
||||||
static MetaGroup*
|
static MetaGroup*
|
||||||
meta_group_new (MetaDisplay *display,
|
meta_group_new (MetaX11Display *x11_display,
|
||||||
Window group_leader)
|
Window group_leader)
|
||||||
{
|
{
|
||||||
MetaGroup *group;
|
MetaGroup *group;
|
||||||
#define N_INITIAL_PROPS 3
|
#define N_INITIAL_PROPS 3
|
||||||
@@ -46,12 +47,12 @@ meta_group_new (MetaDisplay *display,
|
|||||||
|
|
||||||
group = g_new0 (MetaGroup, 1);
|
group = g_new0 (MetaGroup, 1);
|
||||||
|
|
||||||
group->display = display;
|
group->x11_display = x11_display;
|
||||||
group->windows = NULL;
|
group->windows = NULL;
|
||||||
group->group_leader = group_leader;
|
group->group_leader = group_leader;
|
||||||
group->refcount = 1; /* owned by caller, hash table has only weak ref */
|
group->refcount = 1; /* owned by caller, hash table has only weak ref */
|
||||||
|
|
||||||
xcb_connection_t *xcb_conn = XGetXCBConnection (display->xdisplay);
|
xcb_connection_t *xcb_conn = XGetXCBConnection (x11_display->xdisplay);
|
||||||
xcb_generic_error_t *e;
|
xcb_generic_error_t *e;
|
||||||
g_autofree xcb_get_window_attributes_reply_t *attrs =
|
g_autofree xcb_get_window_attributes_reply_t *attrs =
|
||||||
xcb_get_window_attributes_reply (xcb_conn,
|
xcb_get_window_attributes_reply (xcb_conn,
|
||||||
@@ -64,21 +65,21 @@ meta_group_new (MetaDisplay *display,
|
|||||||
xcb_change_window_attributes (xcb_conn, group_leader,
|
xcb_change_window_attributes (xcb_conn, group_leader,
|
||||||
XCB_CW_EVENT_MASK, events);
|
XCB_CW_EVENT_MASK, events);
|
||||||
|
|
||||||
if (display->groups_by_leader == NULL)
|
if (x11_display->groups_by_leader == NULL)
|
||||||
display->groups_by_leader = g_hash_table_new (meta_unsigned_long_hash,
|
x11_display->groups_by_leader = g_hash_table_new (meta_unsigned_long_hash,
|
||||||
meta_unsigned_long_equal);
|
meta_unsigned_long_equal);
|
||||||
|
|
||||||
g_assert (g_hash_table_lookup (display->groups_by_leader, &group_leader) == NULL);
|
g_assert (g_hash_table_lookup (x11_display->groups_by_leader, &group_leader) == NULL);
|
||||||
|
|
||||||
g_hash_table_insert (display->groups_by_leader,
|
g_hash_table_insert (x11_display->groups_by_leader,
|
||||||
&group->group_leader,
|
&group->group_leader,
|
||||||
group);
|
group);
|
||||||
|
|
||||||
/* Fill these in the order we want them to be gotten */
|
/* Fill these in the order we want them to be gotten */
|
||||||
i = 0;
|
i = 0;
|
||||||
initial_props[i++] = display->atom_WM_CLIENT_MACHINE;
|
initial_props[i++] = x11_display->atom_WM_CLIENT_MACHINE;
|
||||||
initial_props[i++] = display->atom__NET_WM_PID;
|
initial_props[i++] = x11_display->atom__NET_WM_PID;
|
||||||
initial_props[i++] = display->atom__NET_STARTUP_ID;
|
initial_props[i++] = x11_display->atom__NET_STARTUP_ID;
|
||||||
g_assert (N_INITIAL_PROPS == i);
|
g_assert (N_INITIAL_PROPS == i);
|
||||||
|
|
||||||
meta_group_reload_properties (group, initial_props, N_INITIAL_PROPS);
|
meta_group_reload_properties (group, initial_props, N_INITIAL_PROPS);
|
||||||
@@ -102,16 +103,16 @@ meta_group_unref (MetaGroup *group)
|
|||||||
"Destroying group with leader 0x%lx\n",
|
"Destroying group with leader 0x%lx\n",
|
||||||
group->group_leader);
|
group->group_leader);
|
||||||
|
|
||||||
g_assert (group->display->groups_by_leader != NULL);
|
g_assert (group->x11_display->groups_by_leader != NULL);
|
||||||
|
|
||||||
g_hash_table_remove (group->display->groups_by_leader,
|
g_hash_table_remove (group->x11_display->groups_by_leader,
|
||||||
&group->group_leader);
|
&group->group_leader);
|
||||||
|
|
||||||
/* mop up hash table, this is how it gets freed on display close */
|
/* mop up hash table, this is how it gets freed on display close */
|
||||||
if (g_hash_table_size (group->display->groups_by_leader) == 0)
|
if (g_hash_table_size (group->x11_display->groups_by_leader) == 0)
|
||||||
{
|
{
|
||||||
g_hash_table_destroy (group->display->groups_by_leader);
|
g_hash_table_destroy (group->x11_display->groups_by_leader);
|
||||||
group->display->groups_by_leader = NULL;
|
group->x11_display->groups_by_leader = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (group->wm_client_machine);
|
g_free (group->wm_client_machine);
|
||||||
@@ -140,6 +141,7 @@ meta_window_compute_group (MetaWindow* window)
|
|||||||
{
|
{
|
||||||
MetaGroup *group;
|
MetaGroup *group;
|
||||||
MetaWindow *ancestor;
|
MetaWindow *ancestor;
|
||||||
|
MetaX11Display *x11_display = window->display->x11_display;
|
||||||
|
|
||||||
/* use window->xwindow if no window->xgroup_leader */
|
/* use window->xwindow if no window->xgroup_leader */
|
||||||
|
|
||||||
@@ -150,15 +152,15 @@ meta_window_compute_group (MetaWindow* window)
|
|||||||
*/
|
*/
|
||||||
ancestor = meta_window_find_root_ancestor (window);
|
ancestor = meta_window_find_root_ancestor (window);
|
||||||
|
|
||||||
if (window->display->groups_by_leader)
|
if (x11_display->groups_by_leader)
|
||||||
{
|
{
|
||||||
if (ancestor != window)
|
if (ancestor != window)
|
||||||
group = ancestor->group;
|
group = ancestor->group;
|
||||||
else if (window->xgroup_leader != None)
|
else if (window->xgroup_leader != None)
|
||||||
group = g_hash_table_lookup (window->display->groups_by_leader,
|
group = g_hash_table_lookup (x11_display->groups_by_leader,
|
||||||
&window->xgroup_leader);
|
&window->xgroup_leader);
|
||||||
else
|
else
|
||||||
group = g_hash_table_lookup (window->display->groups_by_leader,
|
group = g_hash_table_lookup (x11_display->groups_by_leader,
|
||||||
&window->xwindow);
|
&window->xwindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,13 +172,13 @@ meta_window_compute_group (MetaWindow* window)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ancestor != window && ancestor->xgroup_leader != None)
|
if (ancestor != window && ancestor->xgroup_leader != None)
|
||||||
group = meta_group_new (window->display,
|
group = meta_group_new (x11_display,
|
||||||
ancestor->xgroup_leader);
|
ancestor->xgroup_leader);
|
||||||
else if (window->xgroup_leader != None)
|
else if (window->xgroup_leader != None)
|
||||||
group = meta_group_new (window->display,
|
group = meta_group_new (x11_display,
|
||||||
window->xgroup_leader);
|
window->xgroup_leader);
|
||||||
else
|
else
|
||||||
group = meta_group_new (window->display,
|
group = meta_group_new (x11_display,
|
||||||
window->xwindow);
|
window->xwindow);
|
||||||
|
|
||||||
window->group = group;
|
window->group = group;
|
||||||
@@ -223,21 +225,21 @@ meta_window_shutdown_group (MetaWindow *window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_display_lookup_group: (skip)
|
* meta_x11_display_lookup_group: (skip)
|
||||||
* @display: a #MetaDisplay
|
* @x11_display: a #MetaX11Display
|
||||||
* @group_leader: a X window
|
* @group_leader: a X window
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
MetaGroup*
|
MetaGroup *
|
||||||
meta_display_lookup_group (MetaDisplay *display,
|
meta_x11_display_lookup_group (MetaX11Display *x11_display,
|
||||||
Window group_leader)
|
Window group_leader)
|
||||||
{
|
{
|
||||||
MetaGroup *group;
|
MetaGroup *group;
|
||||||
|
|
||||||
group = NULL;
|
group = NULL;
|
||||||
|
|
||||||
if (display->groups_by_leader)
|
if (x11_display->groups_by_leader)
|
||||||
group = g_hash_table_lookup (display->groups_by_leader,
|
group = g_hash_table_lookup (x11_display->groups_by_leader,
|
||||||
&group_leader);
|
&group_leader);
|
||||||
|
|
||||||
return group;
|
return group;
|
||||||
@@ -274,10 +276,10 @@ meta_group_update_layers (MetaGroup *group)
|
|||||||
* but doesn't hurt anything. have to handle
|
* but doesn't hurt anything. have to handle
|
||||||
* groups that span 2 screens.
|
* groups that span 2 screens.
|
||||||
*/
|
*/
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->display->stack);
|
||||||
frozen_stacks = g_slist_prepend (frozen_stacks, window->screen->stack);
|
frozen_stacks = g_slist_prepend (frozen_stacks, window->display->stack);
|
||||||
|
|
||||||
meta_stack_update_layer (window->screen->stack,
|
meta_stack_update_layer (window->display->stack,
|
||||||
window);
|
window);
|
||||||
|
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
|
|||||||
@@ -21,9 +21,10 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
#include "iconcache.h"
|
#include "iconcache.h"
|
||||||
|
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
|
|
||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
#include <cairo-xlib.h>
|
#include <cairo-xlib.h>
|
||||||
@@ -188,7 +189,7 @@ argbdata_to_surface (gulong *argb_data, int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
read_rgb_icon (MetaDisplay *display,
|
read_rgb_icon (MetaX11Display *x11_display,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
int ideal_width,
|
int ideal_width,
|
||||||
int ideal_height,
|
int ideal_height,
|
||||||
@@ -209,16 +210,16 @@ read_rgb_icon (MetaDisplay *display,
|
|||||||
int mini_w, mini_h;
|
int mini_w, mini_h;
|
||||||
gulong *data_as_long;
|
gulong *data_as_long;
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
type = None;
|
type = None;
|
||||||
data = NULL;
|
data = NULL;
|
||||||
result = XGetWindowProperty (display->xdisplay,
|
result = XGetWindowProperty (x11_display->xdisplay,
|
||||||
xwindow,
|
xwindow,
|
||||||
display->atom__NET_WM_ICON,
|
x11_display->atom__NET_WM_ICON,
|
||||||
0, G_MAXLONG,
|
0, G_MAXLONG,
|
||||||
False, XA_CARDINAL, &type, &format, &nitems,
|
False, XA_CARDINAL, &type, &format, &nitems,
|
||||||
&bytes_after, &data);
|
&bytes_after, &data);
|
||||||
err = meta_error_trap_pop_with_return (display);
|
err = meta_x11_error_trap_pop_with_return (x11_display);
|
||||||
|
|
||||||
if (err != Success ||
|
if (err != Success ||
|
||||||
result != Success)
|
result != Success)
|
||||||
@@ -257,11 +258,11 @@ read_rgb_icon (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_pixmap_geometry (MetaDisplay *display,
|
get_pixmap_geometry (MetaX11Display *x11_display,
|
||||||
Pixmap pixmap,
|
Pixmap pixmap,
|
||||||
int *w,
|
int *w,
|
||||||
int *h,
|
int *h,
|
||||||
int *d)
|
int *d)
|
||||||
{
|
{
|
||||||
Window root_ignored;
|
Window root_ignored;
|
||||||
int x_ignored, y_ignored;
|
int x_ignored, y_ignored;
|
||||||
@@ -276,7 +277,7 @@ get_pixmap_geometry (MetaDisplay *display,
|
|||||||
if (d)
|
if (d)
|
||||||
*d = 1;
|
*d = 1;
|
||||||
|
|
||||||
XGetGeometry (display->xdisplay,
|
XGetGeometry (x11_display->xdisplay,
|
||||||
pixmap, &root_ignored, &x_ignored, &y_ignored,
|
pixmap, &root_ignored, &x_ignored, &y_ignored,
|
||||||
&width, &height, &border_width_ignored, &depth);
|
&width, &height, &border_width_ignored, &depth);
|
||||||
|
|
||||||
@@ -327,32 +328,32 @@ surface_from_pixmap (Display *xdisplay, Pixmap xpixmap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
try_pixmap_and_mask (MetaDisplay *display,
|
try_pixmap_and_mask (MetaX11Display *x11_display,
|
||||||
Pixmap src_pixmap,
|
Pixmap src_pixmap,
|
||||||
Pixmap src_mask,
|
Pixmap src_mask,
|
||||||
cairo_surface_t **iconp)
|
cairo_surface_t **iconp)
|
||||||
{
|
{
|
||||||
Display *xdisplay = display->xdisplay;
|
Display *xdisplay = x11_display->xdisplay;
|
||||||
cairo_surface_t *icon, *mask = NULL;
|
cairo_surface_t *icon, *mask = NULL;
|
||||||
int w, h, d;
|
int w, h, d;
|
||||||
|
|
||||||
if (src_pixmap == None)
|
if (src_pixmap == None)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
|
|
||||||
get_pixmap_geometry (display, src_pixmap, &w, &h, &d);
|
get_pixmap_geometry (x11_display, src_pixmap, &w, &h, &d);
|
||||||
icon = surface_from_pixmap (xdisplay, src_pixmap, w, h);
|
icon = surface_from_pixmap (xdisplay, src_pixmap, w, h);
|
||||||
|
|
||||||
if (icon && src_mask != None)
|
if (icon && src_mask != None)
|
||||||
{
|
{
|
||||||
get_pixmap_geometry (display, src_mask, &w, &h, &d);
|
get_pixmap_geometry (x11_display, src_mask, &w, &h, &d);
|
||||||
|
|
||||||
if (d == 1)
|
if (d == 1)
|
||||||
mask = surface_from_pixmap (xdisplay, src_mask, w, h);
|
mask = surface_from_pixmap (xdisplay, src_mask, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_error_trap_pop (display);
|
meta_x11_error_trap_pop (x11_display);
|
||||||
|
|
||||||
if (icon && mask)
|
if (icon && mask)
|
||||||
{
|
{
|
||||||
@@ -387,10 +388,10 @@ try_pixmap_and_mask (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_kwm_win_icon (MetaDisplay *display,
|
get_kwm_win_icon (MetaX11Display *x11_display,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
Pixmap *pixmap,
|
Pixmap *pixmap,
|
||||||
Pixmap *mask)
|
Pixmap *mask)
|
||||||
{
|
{
|
||||||
Atom type;
|
Atom type;
|
||||||
int format;
|
int format;
|
||||||
@@ -403,23 +404,23 @@ get_kwm_win_icon (MetaDisplay *display,
|
|||||||
*pixmap = None;
|
*pixmap = None;
|
||||||
*mask = None;
|
*mask = None;
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_x11_error_trap_push (x11_display);
|
||||||
icons = NULL;
|
icons = NULL;
|
||||||
result = XGetWindowProperty (display->xdisplay, xwindow,
|
result = XGetWindowProperty (x11_display->xdisplay, xwindow,
|
||||||
display->atom__KWM_WIN_ICON,
|
x11_display->atom__KWM_WIN_ICON,
|
||||||
0, G_MAXLONG,
|
0, G_MAXLONG,
|
||||||
False,
|
False,
|
||||||
display->atom__KWM_WIN_ICON,
|
x11_display->atom__KWM_WIN_ICON,
|
||||||
&type, &format, &nitems,
|
&type, &format, &nitems,
|
||||||
&bytes_after, &data);
|
&bytes_after, &data);
|
||||||
icons = (Pixmap *)data;
|
icons = (Pixmap *)data;
|
||||||
|
|
||||||
err = meta_error_trap_pop_with_return (display);
|
err = meta_x11_error_trap_pop_with_return (x11_display);
|
||||||
if (err != Success ||
|
if (err != Success ||
|
||||||
result != Success)
|
result != Success)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (type != display->atom__KWM_WIN_ICON)
|
if (type != x11_display->atom__KWM_WIN_ICON)
|
||||||
{
|
{
|
||||||
XFree (icons);
|
XFree (icons);
|
||||||
return;
|
return;
|
||||||
@@ -447,13 +448,13 @@ meta_icon_cache_init (MetaIconCache *icon_cache)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_icon_cache_property_changed (MetaIconCache *icon_cache,
|
meta_icon_cache_property_changed (MetaIconCache *icon_cache,
|
||||||
MetaDisplay *display,
|
MetaX11Display *x11_display,
|
||||||
Atom atom)
|
Atom atom)
|
||||||
{
|
{
|
||||||
if (atom == display->atom__NET_WM_ICON)
|
if (atom == x11_display->atom__NET_WM_ICON)
|
||||||
icon_cache->net_wm_icon_dirty = TRUE;
|
icon_cache->net_wm_icon_dirty = TRUE;
|
||||||
else if (atom == display->atom__KWM_WIN_ICON)
|
else if (atom == x11_display->atom__KWM_WIN_ICON)
|
||||||
icon_cache->kwm_win_icon_dirty = TRUE;
|
icon_cache->kwm_win_icon_dirty = TRUE;
|
||||||
else if (atom == XA_WM_HINTS)
|
else if (atom == XA_WM_HINTS)
|
||||||
icon_cache->wm_hints_dirty = TRUE;
|
icon_cache->wm_hints_dirty = TRUE;
|
||||||
@@ -478,7 +479,7 @@ meta_icon_cache_get_icon_invalidated (MetaIconCache *icon_cache)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_read_icons (MetaScreen *screen,
|
meta_read_icons (MetaX11Display *x11_display,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
MetaIconCache *icon_cache,
|
MetaIconCache *icon_cache,
|
||||||
Pixmap wm_hints_pixmap,
|
Pixmap wm_hints_pixmap,
|
||||||
@@ -514,7 +515,7 @@ meta_read_icons (MetaScreen *screen,
|
|||||||
{
|
{
|
||||||
icon_cache->net_wm_icon_dirty = FALSE;
|
icon_cache->net_wm_icon_dirty = FALSE;
|
||||||
|
|
||||||
if (read_rgb_icon (screen->display, xwindow,
|
if (read_rgb_icon (x11_display, xwindow,
|
||||||
ideal_width, ideal_height,
|
ideal_width, ideal_height,
|
||||||
ideal_mini_width, ideal_mini_height,
|
ideal_mini_width, ideal_mini_height,
|
||||||
iconp, mini_iconp))
|
iconp, mini_iconp))
|
||||||
@@ -543,7 +544,7 @@ meta_read_icons (MetaScreen *screen,
|
|||||||
mask != icon_cache->prev_mask) &&
|
mask != icon_cache->prev_mask) &&
|
||||||
pixmap != None)
|
pixmap != None)
|
||||||
{
|
{
|
||||||
if (try_pixmap_and_mask (screen->display, pixmap, mask, iconp))
|
if (try_pixmap_and_mask (x11_display, pixmap, mask, iconp))
|
||||||
{
|
{
|
||||||
*mini_iconp = cairo_surface_reference (*iconp);
|
*mini_iconp = cairo_surface_reference (*iconp);
|
||||||
icon_cache->prev_pixmap = pixmap;
|
icon_cache->prev_pixmap = pixmap;
|
||||||
@@ -562,13 +563,13 @@ meta_read_icons (MetaScreen *screen,
|
|||||||
|
|
||||||
icon_cache->kwm_win_icon_dirty = FALSE;
|
icon_cache->kwm_win_icon_dirty = FALSE;
|
||||||
|
|
||||||
get_kwm_win_icon (screen->display, xwindow, &pixmap, &mask);
|
get_kwm_win_icon (x11_display, xwindow, &pixmap, &mask);
|
||||||
|
|
||||||
if ((pixmap != icon_cache->prev_pixmap ||
|
if ((pixmap != icon_cache->prev_pixmap ||
|
||||||
mask != icon_cache->prev_mask) &&
|
mask != icon_cache->prev_mask) &&
|
||||||
pixmap != None)
|
pixmap != None)
|
||||||
{
|
{
|
||||||
if (try_pixmap_and_mask (screen->display, pixmap, mask, iconp))
|
if (try_pixmap_and_mask (x11_display, pixmap, mask, iconp))
|
||||||
{
|
{
|
||||||
*mini_iconp = cairo_surface_reference (*iconp);
|
*mini_iconp = cairo_surface_reference (*iconp);
|
||||||
icon_cache->prev_pixmap = pixmap;
|
icon_cache->prev_pixmap = pixmap;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#ifndef META_ICON_CACHE_H
|
#ifndef META_ICON_CACHE_H
|
||||||
#define META_ICON_CACHE_H
|
#define META_ICON_CACHE_H
|
||||||
|
|
||||||
#include "screen-private.h"
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
typedef struct _MetaIconCache MetaIconCache;
|
typedef struct _MetaIconCache MetaIconCache;
|
||||||
|
|
||||||
@@ -50,13 +50,13 @@ struct _MetaIconCache
|
|||||||
guint net_wm_icon_dirty : 1;
|
guint net_wm_icon_dirty : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
void meta_icon_cache_init (MetaIconCache *icon_cache);
|
void meta_icon_cache_init (MetaIconCache *icon_cache);
|
||||||
void meta_icon_cache_property_changed (MetaIconCache *icon_cache,
|
void meta_icon_cache_property_changed (MetaIconCache *icon_cache,
|
||||||
MetaDisplay *display,
|
MetaX11Display *x11_display,
|
||||||
Atom atom);
|
Atom atom);
|
||||||
gboolean meta_icon_cache_get_icon_invalidated (MetaIconCache *icon_cache);
|
gboolean meta_icon_cache_get_icon_invalidated (MetaIconCache *icon_cache);
|
||||||
|
|
||||||
gboolean meta_read_icons (MetaScreen *screen,
|
gboolean meta_read_icons (MetaX11Display *x11_display,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
MetaIconCache *icon_cache,
|
MetaIconCache *icon_cache,
|
||||||
Pixmap wm_hints_pixmap,
|
Pixmap wm_hints_pixmap,
|
||||||
|
|||||||
216
src/x11/meta-x11-display-private.h
Normal file
216
src/x11/meta-x11-display-private.h
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
|
||||||
|
/* Mutter X display handler */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2001 Havoc Pennington
|
||||||
|
* Copyright (C) 2002 Red Hat, Inc.
|
||||||
|
* Copyright (C) 2003 Rob Adams
|
||||||
|
* Copyright (C) 2004-2006 Elijah Newren
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef META_X11_DISPLAY_PRIVATE_H
|
||||||
|
#define META_X11_DISPLAY_PRIVATE_H
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
|
#include "backends/meta-monitor-manager-private.h"
|
||||||
|
#include "core/display-private.h"
|
||||||
|
#include "meta/common.h"
|
||||||
|
#include "meta/types.h"
|
||||||
|
#include "meta/meta-x11-display.h"
|
||||||
|
#include "ui/ui.h"
|
||||||
|
|
||||||
|
typedef struct _MetaGroupPropHooks MetaGroupPropHooks;
|
||||||
|
typedef struct _MetaWindowPropHooks MetaWindowPropHooks;
|
||||||
|
|
||||||
|
typedef gboolean (*MetaAlarmFilter) (MetaX11Display *x11_display,
|
||||||
|
XSyncAlarmNotifyEvent *event,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
|
struct _MetaX11Display
|
||||||
|
{
|
||||||
|
GObject parent;
|
||||||
|
|
||||||
|
MetaDisplay *display;
|
||||||
|
GdkDisplay *gdk_display;
|
||||||
|
|
||||||
|
char *name;
|
||||||
|
char *screen_name;
|
||||||
|
|
||||||
|
Display *xdisplay;
|
||||||
|
Window xroot;
|
||||||
|
int default_depth;
|
||||||
|
Visual *default_xvisual;
|
||||||
|
|
||||||
|
guint32 timestamp;
|
||||||
|
|
||||||
|
/* Pull in all the names of atoms as fields; we will intern them when the
|
||||||
|
* class is constructed.
|
||||||
|
*/
|
||||||
|
#define item(x) Atom atom_##x;
|
||||||
|
#include "x11/atomnames.h"
|
||||||
|
#undef item
|
||||||
|
|
||||||
|
Window leader_window;
|
||||||
|
Window timestamp_pinging_window;
|
||||||
|
|
||||||
|
/* The window and serial of the most recent FocusIn event. */
|
||||||
|
Window server_focus_window;
|
||||||
|
gulong server_focus_serial;
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
|
||||||
|
/* This window holds the focus when we don't want to focus
|
||||||
|
* any actual clients
|
||||||
|
*/
|
||||||
|
Window no_focus_window;
|
||||||
|
|
||||||
|
/* Instead of unmapping withdrawn windows we can leave them mapped
|
||||||
|
* and restack them below a guard window. When using a compositor
|
||||||
|
* this allows us to provide live previews of unmapped windows */
|
||||||
|
Window guard_window;
|
||||||
|
|
||||||
|
Window wm_sn_selection_window;
|
||||||
|
Atom wm_sn_atom;
|
||||||
|
guint32 wm_sn_timestamp;
|
||||||
|
|
||||||
|
Window wm_cm_selection_window;
|
||||||
|
|
||||||
|
Window composite_overlay_window;
|
||||||
|
|
||||||
|
GHashTable *xids;
|
||||||
|
|
||||||
|
gboolean has_xinerama_indices;
|
||||||
|
|
||||||
|
/* Managed by group.c */
|
||||||
|
GHashTable *groups_by_leader;
|
||||||
|
|
||||||
|
/* Managed by window-props.c */
|
||||||
|
MetaWindowPropHooks *prop_hooks_table;
|
||||||
|
GHashTable *prop_hooks;
|
||||||
|
int n_prop_hooks;
|
||||||
|
|
||||||
|
/* Managed by group-props.c */
|
||||||
|
MetaGroupPropHooks *group_prop_hooks;
|
||||||
|
|
||||||
|
int xkb_base_event_type;
|
||||||
|
guint32 last_bell_time;
|
||||||
|
|
||||||
|
MetaAlarmFilter alarm_filter;
|
||||||
|
gpointer alarm_filter_data;
|
||||||
|
|
||||||
|
MetaUI *ui;
|
||||||
|
|
||||||
|
guint keys_grabbed : 1;
|
||||||
|
|
||||||
|
int composite_event_base;
|
||||||
|
int composite_error_base;
|
||||||
|
int composite_major_version;
|
||||||
|
int composite_minor_version;
|
||||||
|
int damage_event_base;
|
||||||
|
int damage_error_base;
|
||||||
|
int xfixes_event_base;
|
||||||
|
int xfixes_error_base;
|
||||||
|
int xinput_error_base;
|
||||||
|
int xinput_event_base;
|
||||||
|
int xinput_opcode;
|
||||||
|
int xsync_event_base;
|
||||||
|
int xsync_error_base;
|
||||||
|
int shape_event_base;
|
||||||
|
int shape_error_base;
|
||||||
|
unsigned int have_xsync : 1;
|
||||||
|
#define META_X11_DISPLAY_HAS_XSYNC(x11_display) ((x11_display)->have_xsync)
|
||||||
|
unsigned int have_shape : 1;
|
||||||
|
#define META_X11_DISPLAY_HAS_SHAPE(x11_display) ((x11_display)->have_shape)
|
||||||
|
unsigned int have_composite : 1;
|
||||||
|
unsigned int have_damage : 1;
|
||||||
|
#define META_X11_DISPLAY_HAS_COMPOSITE(x11_display) ((x11_display)->have_composite)
|
||||||
|
#define META_X11_DISPLAY_HAS_DAMAGE(x11_display) ((x11_display)->have_damage)
|
||||||
|
#ifdef HAVE_XI23
|
||||||
|
gboolean have_xinput_23 : 1;
|
||||||
|
#define META_X11_DISPLAY_HAS_XINPUT_23(x11_display) ((x11_display)->have_xinput_23)
|
||||||
|
#else
|
||||||
|
#define META_X11_DISPLAY_HAS_XINPUT_23(x11_display) FALSE
|
||||||
|
#endif /* HAVE_XI23 */
|
||||||
|
};
|
||||||
|
|
||||||
|
MetaX11Display *meta_x11_display_new (MetaDisplay *display, GError **error);
|
||||||
|
|
||||||
|
Window meta_x11_display_create_offscreen_window (MetaX11Display *x11_display,
|
||||||
|
Window parent,
|
||||||
|
long valuemask);
|
||||||
|
|
||||||
|
Cursor meta_x11_display_create_x_cursor (MetaX11Display *x11_display,
|
||||||
|
MetaCursor cursor);
|
||||||
|
|
||||||
|
void meta_x11_display_reload_cursor (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
MetaWindow *meta_x11_display_lookup_x_window (MetaX11Display *x11_display,
|
||||||
|
Window xwindow);
|
||||||
|
void meta_x11_display_register_x_window (MetaX11Display *x11_display,
|
||||||
|
Window *xwindowp,
|
||||||
|
MetaWindow *window);
|
||||||
|
void meta_x11_display_unregister_x_window (MetaX11Display *x11_display,
|
||||||
|
Window xwindow);
|
||||||
|
|
||||||
|
MetaWindow *meta_x11_display_lookup_sync_alarm (MetaX11Display *x11_display,
|
||||||
|
XSyncAlarm alarm);
|
||||||
|
void meta_x11_display_register_sync_alarm (MetaX11Display *x11_display,
|
||||||
|
XSyncAlarm *alarmp,
|
||||||
|
MetaWindow *window);
|
||||||
|
void meta_x11_display_unregister_sync_alarm (MetaX11Display *x11_display,
|
||||||
|
XSyncAlarm alarm);
|
||||||
|
|
||||||
|
#ifdef HAVE_XI23
|
||||||
|
gboolean meta_x11_display_process_barrier_xevent (MetaX11Display *x11_display,
|
||||||
|
XIEvent *event);
|
||||||
|
#endif /* HAVE_XI23 */
|
||||||
|
|
||||||
|
void meta_x11_display_set_alarm_filter (MetaX11Display *x11_display,
|
||||||
|
MetaAlarmFilter filter,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
|
void meta_x11_display_create_guard_window (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
/* make a request to ensure the event serial has changed */
|
||||||
|
void meta_x11_display_increment_event_serial (MetaX11Display *x11_display);
|
||||||
|
void meta_x11_display_update_active_window_hint (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
guint32 meta_x11_display_get_current_time_roundtrip (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
void meta_x11_display_set_input_focus_xwindow (MetaX11Display *x11_display,
|
||||||
|
Window window,
|
||||||
|
guint32 timestamp);
|
||||||
|
|
||||||
|
int meta_x11_display_logical_monitor_to_xinerama_index (MetaX11Display *x11_display,
|
||||||
|
MetaLogicalMonitor *logical_monitor);
|
||||||
|
|
||||||
|
MetaLogicalMonitor *meta_x11_display_xinerama_index_to_logical_monitor (MetaX11Display *x11_display,
|
||||||
|
int xinerama_index);
|
||||||
|
|
||||||
|
void meta_x11_display_update_workspace_layout (MetaX11Display *x11_display);
|
||||||
|
void meta_x11_display_update_workspace_names (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
void update_cursor_size_from_gtk (GtkSettings *settings,
|
||||||
|
GParamSpec *pspec,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
|
#endif /* META_X11_DISPLAY_PRIVATE_H */
|
||||||
2128
src/x11/meta-x11-display.c
Normal file
2128
src/x11/meta-x11-display.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -25,11 +25,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <meta/errors.h>
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "display-private.h"
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdkx.h>
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
/* In GTK+-3.0, the error trapping code was significantly rewritten. The new code
|
/* In GTK+-3.0, the error trapping code was significantly rewritten. The new code
|
||||||
* has some neat features (like knowing automatically if a sync is needed or not
|
* has some neat features (like knowing automatically if a sync is needed or not
|
||||||
@@ -44,19 +44,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_error_trap_push (MetaDisplay *display)
|
meta_x11_error_trap_push (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
gdk_error_trap_push ();
|
gdk_x11_display_error_trap_push (x11_display->gdk_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_error_trap_pop (MetaDisplay *display)
|
meta_x11_error_trap_pop (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
gdk_error_trap_pop_ignored ();
|
gdk_x11_display_error_trap_pop_ignored (x11_display->gdk_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
meta_error_trap_pop_with_return (MetaDisplay *display)
|
meta_x11_error_trap_pop_with_return (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
return gdk_error_trap_pop ();
|
return gdk_x11_display_error_trap_pop (x11_display->gdk_display);
|
||||||
}
|
}
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "util-private.h"
|
#include "util-private.h"
|
||||||
#include <meta/main.h>
|
#include <meta/main.h>
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -1816,7 +1817,7 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
|
|||||||
"and will have to be restarted manually next time "
|
"and will have to be restarted manually next time "
|
||||||
"you log in."),
|
"you log in."),
|
||||||
"240",
|
"240",
|
||||||
meta_get_display()->screen->screen_name,
|
meta_get_display()->x11_display->screen_name,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
None,
|
None,
|
||||||
columns,
|
columns,
|
||||||
|
|||||||
@@ -40,7 +40,8 @@
|
|||||||
#include "window-props.h"
|
#include "window-props.h"
|
||||||
#include "window-x11.h"
|
#include "window-x11.h"
|
||||||
#include "window-x11-private.h"
|
#include "window-x11-private.h"
|
||||||
#include <meta/errors.h>
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
#include <meta/meta-x11-errors.h>
|
||||||
#include "xprops.h"
|
#include "xprops.h"
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include <meta/group.h>
|
#include <meta/group.h>
|
||||||
@@ -48,6 +49,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "util-private.h"
|
#include "util-private.h"
|
||||||
|
#include "meta-workspace-manager-private.h"
|
||||||
|
|
||||||
#ifndef HOST_NAME_MAX
|
#ifndef HOST_NAME_MAX
|
||||||
/* Solaris headers apparently don't define this so do so manually; #326745 */
|
/* Solaris headers apparently don't define this so do so manually; #326745 */
|
||||||
@@ -81,8 +83,8 @@ static void reload_prop_value (MetaWindow *window,
|
|||||||
MetaWindowPropHooks *hooks,
|
MetaWindowPropHooks *hooks,
|
||||||
MetaPropValue *value,
|
MetaPropValue *value,
|
||||||
gboolean initial);
|
gboolean initial);
|
||||||
static MetaWindowPropHooks* find_hooks (MetaDisplay *display,
|
static MetaWindowPropHooks *find_hooks (MetaX11Display *x11_display,
|
||||||
Atom property);
|
Atom property);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -94,7 +96,7 @@ meta_window_reload_property_from_xwindow (MetaWindow *window,
|
|||||||
MetaPropValue value = { 0, };
|
MetaPropValue value = { 0, };
|
||||||
MetaWindowPropHooks *hooks;
|
MetaWindowPropHooks *hooks;
|
||||||
|
|
||||||
hooks = find_hooks (window->display, property);
|
hooks = find_hooks (window->display->x11_display, property);
|
||||||
if (!hooks)
|
if (!hooks)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -103,7 +105,7 @@ meta_window_reload_property_from_xwindow (MetaWindow *window,
|
|||||||
|
|
||||||
init_prop_value (window, hooks, &value);
|
init_prop_value (window, hooks, &value);
|
||||||
|
|
||||||
meta_prop_get_values (window->display, xwindow,
|
meta_prop_get_values (window->display->x11_display, xwindow,
|
||||||
&value, 1);
|
&value, 1);
|
||||||
|
|
||||||
reload_prop_value (window, hooks, &value,
|
reload_prop_value (window, hooks, &value,
|
||||||
@@ -129,13 +131,14 @@ meta_window_load_initial_properties (MetaWindow *window)
|
|||||||
int i, j;
|
int i, j;
|
||||||
MetaPropValue *values;
|
MetaPropValue *values;
|
||||||
int n_properties = 0;
|
int n_properties = 0;
|
||||||
|
MetaX11Display *x11_display = window->display->x11_display;
|
||||||
|
|
||||||
values = g_new0 (MetaPropValue, window->display->n_prop_hooks);
|
values = g_new0 (MetaPropValue, x11_display->n_prop_hooks);
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
for (i = 0; i < window->display->n_prop_hooks; i++)
|
for (i = 0; i < x11_display->n_prop_hooks; i++)
|
||||||
{
|
{
|
||||||
MetaWindowPropHooks *hooks = &window->display->prop_hooks_table[i];
|
MetaWindowPropHooks *hooks = &x11_display->prop_hooks_table[i];
|
||||||
if (hooks->flags & LOAD_INIT)
|
if (hooks->flags & LOAD_INIT)
|
||||||
{
|
{
|
||||||
init_prop_value (window, hooks, &values[j]);
|
init_prop_value (window, hooks, &values[j]);
|
||||||
@@ -144,13 +147,13 @@ meta_window_load_initial_properties (MetaWindow *window)
|
|||||||
}
|
}
|
||||||
n_properties = j;
|
n_properties = j;
|
||||||
|
|
||||||
meta_prop_get_values (window->display, window->xwindow,
|
meta_prop_get_values (window->display->x11_display, window->xwindow,
|
||||||
values, n_properties);
|
values, n_properties);
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
for (i = 0; i < window->display->n_prop_hooks; i++)
|
for (i = 0; i < x11_display->n_prop_hooks; i++)
|
||||||
{
|
{
|
||||||
MetaWindowPropHooks *hooks = &window->display->prop_hooks_table[i];
|
MetaWindowPropHooks *hooks = &x11_display->prop_hooks_table[i];
|
||||||
if (hooks->flags & LOAD_INIT)
|
if (hooks->flags & LOAD_INIT)
|
||||||
{
|
{
|
||||||
/* If we didn't actually manage to load anything then we don't need
|
/* If we didn't actually manage to load anything then we don't need
|
||||||
@@ -240,6 +243,7 @@ reload_net_wm_window_type (MetaWindow *window,
|
|||||||
MetaPropValue *value,
|
MetaPropValue *value,
|
||||||
gboolean initial)
|
gboolean initial)
|
||||||
{
|
{
|
||||||
|
MetaX11Display *x11_display = window->display->x11_display;
|
||||||
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
|
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
|
||||||
MetaWindowX11Private *priv = window_x11->priv;
|
MetaWindowX11Private *priv = window_x11->priv;
|
||||||
|
|
||||||
@@ -254,20 +258,20 @@ reload_net_wm_window_type (MetaWindow *window,
|
|||||||
/* We break as soon as we find one we recognize,
|
/* We break as soon as we find one we recognize,
|
||||||
* supposed to prefer those near the front of the list
|
* supposed to prefer those near the front of the list
|
||||||
*/
|
*/
|
||||||
if (atom == window->display->atom__NET_WM_WINDOW_TYPE_DESKTOP ||
|
if (atom == x11_display->atom__NET_WM_WINDOW_TYPE_DESKTOP ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_DOCK ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_DOCK ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_TOOLBAR ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_TOOLBAR ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_MENU ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_MENU ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_UTILITY ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_UTILITY ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_SPLASH ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_SPLASH ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_DIALOG ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_DIALOG ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_DROPDOWN_MENU ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_DROPDOWN_MENU ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_POPUP_MENU ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_POPUP_MENU ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_TOOLTIP ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_TOOLTIP ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_NOTIFICATION ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_NOTIFICATION ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_COMBO ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_COMBO ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_DND ||
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_DND ||
|
||||||
atom == window->display->atom__NET_WM_WINDOW_TYPE_NORMAL)
|
atom == x11_display->atom__NET_WM_WINDOW_TYPE_NORMAL)
|
||||||
{
|
{
|
||||||
priv->type_atom = atom;
|
priv->type_atom = atom;
|
||||||
break;
|
break;
|
||||||
@@ -286,7 +290,7 @@ reload_icon (MetaWindow *window,
|
|||||||
MetaWindowX11Private *priv = window_x11->priv;
|
MetaWindowX11Private *priv = window_x11->priv;
|
||||||
|
|
||||||
meta_icon_cache_property_changed (&priv->icon_cache,
|
meta_icon_cache_property_changed (&priv->icon_cache,
|
||||||
window->display,
|
window->display->x11_display,
|
||||||
atom);
|
atom);
|
||||||
meta_window_queue(window, META_QUEUE_UPDATE_ICON);
|
meta_window_queue(window, META_QUEUE_UPDATE_ICON);
|
||||||
}
|
}
|
||||||
@@ -296,7 +300,7 @@ reload_net_wm_icon (MetaWindow *window,
|
|||||||
MetaPropValue *value,
|
MetaPropValue *value,
|
||||||
gboolean initial)
|
gboolean initial)
|
||||||
{
|
{
|
||||||
reload_icon (window, window->display->atom__NET_WM_ICON);
|
reload_icon (window, window->display->x11_display->atom__NET_WM_ICON);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -304,7 +308,7 @@ reload_kwm_win_icon (MetaWindow *window,
|
|||||||
MetaPropValue *value,
|
MetaPropValue *value,
|
||||||
gboolean initial)
|
gboolean initial)
|
||||||
{
|
{
|
||||||
reload_icon (window, window->display->atom__KWM_WIN_ICON);
|
reload_icon (window, window->display->x11_display->atom__KWM_WIN_ICON);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -466,10 +470,10 @@ reload_net_wm_user_time_window (MetaWindow *window,
|
|||||||
if (window->user_time_window != None)
|
if (window->user_time_window != None)
|
||||||
{
|
{
|
||||||
/* See the comment to the meta_display_register_x_window call below. */
|
/* See the comment to the meta_display_register_x_window call below. */
|
||||||
meta_display_unregister_x_window (window->display,
|
meta_x11_display_unregister_x_window (window->display->x11_display,
|
||||||
window->user_time_window);
|
window->user_time_window);
|
||||||
/* Don't get events on not-managed windows */
|
/* Don't get events on not-managed windows */
|
||||||
XSelectInput (window->display->xdisplay,
|
XSelectInput (window->display->x11_display->xdisplay,
|
||||||
window->user_time_window,
|
window->user_time_window,
|
||||||
NoEventMask);
|
NoEventMask);
|
||||||
}
|
}
|
||||||
@@ -477,10 +481,12 @@ reload_net_wm_user_time_window (MetaWindow *window,
|
|||||||
/* Ensure the new user time window is not used on another MetaWindow,
|
/* Ensure the new user time window is not used on another MetaWindow,
|
||||||
* and unset its user time window if that is the case.
|
* and unset its user time window if that is the case.
|
||||||
*/
|
*/
|
||||||
prev_owner = meta_display_lookup_x_window (window->display, value->v.xwindow);
|
prev_owner = meta_x11_display_lookup_x_window (window->display->x11_display,
|
||||||
|
value->v.xwindow);
|
||||||
if (prev_owner && prev_owner->user_time_window == value->v.xwindow)
|
if (prev_owner && prev_owner->user_time_window == value->v.xwindow)
|
||||||
{
|
{
|
||||||
meta_display_unregister_x_window (window->display, value->v.xwindow);
|
meta_x11_display_unregister_x_window (window->display->x11_display,
|
||||||
|
value->v.xwindow);
|
||||||
prev_owner->user_time_window = None;
|
prev_owner->user_time_window = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,11 +506,11 @@ reload_net_wm_user_time_window (MetaWindow *window,
|
|||||||
* than atom__NET_WM_USER_TIME ones, but I just don't care
|
* than atom__NET_WM_USER_TIME ones, but I just don't care
|
||||||
* and it's not specified in the spec anyway.
|
* and it's not specified in the spec anyway.
|
||||||
*/
|
*/
|
||||||
meta_display_register_x_window (window->display,
|
meta_x11_display_register_x_window (window->display->x11_display,
|
||||||
&window->user_time_window,
|
&window->user_time_window,
|
||||||
window);
|
window);
|
||||||
/* Just listen for property notify events */
|
/* Just listen for property notify events */
|
||||||
XSelectInput (window->display->xdisplay,
|
XSelectInput (window->display->x11_display->xdisplay,
|
||||||
window->user_time_window,
|
window->user_time_window,
|
||||||
PropertyChangeMask);
|
PropertyChangeMask);
|
||||||
|
|
||||||
@@ -515,7 +521,7 @@ reload_net_wm_user_time_window (MetaWindow *window,
|
|||||||
meta_window_reload_property_from_xwindow (
|
meta_window_reload_property_from_xwindow (
|
||||||
window,
|
window,
|
||||||
window->user_time_window,
|
window->user_time_window,
|
||||||
window->display->atom__NET_WM_USER_TIME,
|
window->display->x11_display->atom__NET_WM_USER_TIME,
|
||||||
initial);
|
initial);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -564,18 +570,18 @@ set_title_text (MetaWindow *window,
|
|||||||
*target = g_strdup (title);
|
*target = g_strdup (title);
|
||||||
|
|
||||||
if (modified && atom != None)
|
if (modified && atom != None)
|
||||||
meta_prop_set_utf8_string_hint (window->display,
|
meta_prop_set_utf8_string_hint (window->display->x11_display,
|
||||||
window->xwindow,
|
window->xwindow,
|
||||||
atom, *target);
|
atom, *target);
|
||||||
|
|
||||||
/* Bug 330671 -- Don't forget to clear _NET_WM_VISIBLE_(ICON_)NAME */
|
/* Bug 330671 -- Don't forget to clear _NET_WM_VISIBLE_(ICON_)NAME */
|
||||||
if (!modified && previous_was_modified)
|
if (!modified && previous_was_modified)
|
||||||
{
|
{
|
||||||
meta_error_trap_push (window->display);
|
meta_x11_error_trap_push (window->display->x11_display);
|
||||||
XDeleteProperty (window->display->xdisplay,
|
XDeleteProperty (window->display->x11_display->xdisplay,
|
||||||
window->xwindow,
|
window->xwindow,
|
||||||
atom);
|
atom);
|
||||||
meta_error_trap_pop (window->display);
|
meta_x11_error_trap_pop (window->display->x11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
return modified;
|
return modified;
|
||||||
@@ -594,7 +600,7 @@ set_window_title (MetaWindow *window,
|
|||||||
set_title_text (window,
|
set_title_text (window,
|
||||||
priv->using_net_wm_visible_name,
|
priv->using_net_wm_visible_name,
|
||||||
title,
|
title,
|
||||||
window->display->atom__NET_WM_VISIBLE_NAME,
|
window->display->x11_display->atom__NET_WM_VISIBLE_NAME,
|
||||||
&new_title);
|
&new_title);
|
||||||
priv->using_net_wm_visible_name = modified;
|
priv->using_net_wm_visible_name = modified;
|
||||||
|
|
||||||
@@ -775,6 +781,7 @@ reload_net_wm_state (MetaWindow *window,
|
|||||||
MetaPropValue *value,
|
MetaPropValue *value,
|
||||||
gboolean initial)
|
gboolean initial)
|
||||||
{
|
{
|
||||||
|
MetaX11Display *x11_display = window->display->x11_display;
|
||||||
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
|
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
|
||||||
MetaWindowX11Private *priv = window_x11->priv;
|
MetaWindowX11Private *priv = window_x11->priv;
|
||||||
|
|
||||||
@@ -808,32 +815,32 @@ reload_net_wm_state (MetaWindow *window,
|
|||||||
i = 0;
|
i = 0;
|
||||||
while (i < value->v.atom_list.n_atoms)
|
while (i < value->v.atom_list.n_atoms)
|
||||||
{
|
{
|
||||||
if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_SHADED)
|
if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_SHADED)
|
||||||
window->shaded = TRUE;
|
window->shaded = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_MAXIMIZED_HORZ)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_MAXIMIZED_HORZ)
|
||||||
window->maximize_horizontally_after_placement = TRUE;
|
window->maximize_horizontally_after_placement = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_MAXIMIZED_VERT)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_MAXIMIZED_VERT)
|
||||||
window->maximize_vertically_after_placement = TRUE;
|
window->maximize_vertically_after_placement = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_HIDDEN)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_HIDDEN)
|
||||||
window->minimize_after_placement = TRUE;
|
window->minimize_after_placement = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_MODAL)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_MODAL)
|
||||||
priv->wm_state_modal = TRUE;
|
priv->wm_state_modal = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_SKIP_TASKBAR)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_SKIP_TASKBAR)
|
||||||
priv->wm_state_skip_taskbar = TRUE;
|
priv->wm_state_skip_taskbar = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_SKIP_PAGER)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_SKIP_PAGER)
|
||||||
priv->wm_state_skip_pager = TRUE;
|
priv->wm_state_skip_pager = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_FULLSCREEN)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_FULLSCREEN)
|
||||||
{
|
{
|
||||||
window->fullscreen = TRUE;
|
window->fullscreen = TRUE;
|
||||||
g_object_notify (G_OBJECT (window), "fullscreen");
|
g_object_notify (G_OBJECT (window), "fullscreen");
|
||||||
}
|
}
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_ABOVE)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_ABOVE)
|
||||||
window->wm_state_above = TRUE;
|
window->wm_state_above = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_BELOW)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_BELOW)
|
||||||
window->wm_state_below = TRUE;
|
window->wm_state_below = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_DEMANDS_ATTENTION)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_DEMANDS_ATTENTION)
|
||||||
window->wm_state_demands_attention = TRUE;
|
window->wm_state_demands_attention = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_STICKY)
|
else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_STICKY)
|
||||||
window->on_all_workspaces_requested = TRUE;
|
window->on_all_workspaces_requested = TRUE;
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
@@ -1021,6 +1028,7 @@ reload_net_startup_id (MetaWindow *window,
|
|||||||
MetaPropValue *value,
|
MetaPropValue *value,
|
||||||
gboolean initial)
|
gboolean initial)
|
||||||
{
|
{
|
||||||
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
guint32 timestamp = window->net_wm_user_time;
|
guint32 timestamp = window->net_wm_user_time;
|
||||||
MetaWorkspace *workspace = NULL;
|
MetaWorkspace *workspace = NULL;
|
||||||
|
|
||||||
@@ -1037,13 +1045,14 @@ reload_net_startup_id (MetaWindow *window,
|
|||||||
window->initial_timestamp_set = 0;
|
window->initial_timestamp_set = 0;
|
||||||
window->initial_workspace_set = 0;
|
window->initial_workspace_set = 0;
|
||||||
|
|
||||||
if (meta_screen_apply_startup_properties (window->screen, window))
|
if (meta_display_apply_startup_properties (window->display, window))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (window->initial_timestamp_set)
|
if (window->initial_timestamp_set)
|
||||||
timestamp = window->initial_timestamp;
|
timestamp = window->initial_timestamp;
|
||||||
if (window->initial_workspace_set)
|
if (window->initial_workspace_set)
|
||||||
workspace = meta_screen_get_workspace_by_index (window->screen, window->initial_workspace);
|
workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager,
|
||||||
|
window->initial_workspace);
|
||||||
|
|
||||||
meta_window_activate_with_workspace (window, timestamp, workspace);
|
meta_window_activate_with_workspace (window, timestamp, workspace);
|
||||||
}
|
}
|
||||||
@@ -1533,13 +1542,13 @@ reload_wm_protocols (MetaWindow *window,
|
|||||||
while (i < value->v.atom_list.n_atoms)
|
while (i < value->v.atom_list.n_atoms)
|
||||||
{
|
{
|
||||||
if (value->v.atom_list.atoms[i] ==
|
if (value->v.atom_list.atoms[i] ==
|
||||||
window->display->atom_WM_TAKE_FOCUS)
|
window->display->x11_display->atom_WM_TAKE_FOCUS)
|
||||||
window->take_focus = TRUE;
|
window->take_focus = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] ==
|
else if (value->v.atom_list.atoms[i] ==
|
||||||
window->display->atom_WM_DELETE_WINDOW)
|
window->display->x11_display->atom_WM_DELETE_WINDOW)
|
||||||
window->delete_window = TRUE;
|
window->delete_window = TRUE;
|
||||||
else if (value->v.atom_list.atoms[i] ==
|
else if (value->v.atom_list.atoms[i] ==
|
||||||
window->display->atom__NET_WM_PING)
|
window->display->x11_display->atom__NET_WM_PING)
|
||||||
window->can_ping = TRUE;
|
window->can_ping = TRUE;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
@@ -1609,7 +1618,7 @@ reload_wm_hints (MetaWindow *window,
|
|||||||
meta_window_set_urgent (window, urgent);
|
meta_window_set_urgent (window, urgent);
|
||||||
|
|
||||||
meta_icon_cache_property_changed (&priv->icon_cache,
|
meta_icon_cache_property_changed (&priv->icon_cache,
|
||||||
window->display,
|
window->display->x11_display,
|
||||||
XA_WM_HINTS);
|
XA_WM_HINTS);
|
||||||
|
|
||||||
meta_window_queue (window, META_QUEUE_UPDATE_ICON | META_QUEUE_MOVE_RESIZE);
|
meta_window_queue (window, META_QUEUE_UPDATE_ICON | META_QUEUE_MOVE_RESIZE);
|
||||||
@@ -1627,7 +1636,8 @@ reload_transient_for (MetaWindow *window,
|
|||||||
{
|
{
|
||||||
transient_for = value->v.xwindow;
|
transient_for = value->v.xwindow;
|
||||||
|
|
||||||
parent = meta_display_lookup_x_window (window->display, transient_for);
|
parent = meta_x11_display_lookup_x_window (window->display->x11_display,
|
||||||
|
transient_for);
|
||||||
if (!parent)
|
if (!parent)
|
||||||
{
|
{
|
||||||
meta_warning ("Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n",
|
meta_warning ("Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n",
|
||||||
@@ -1646,8 +1656,8 @@ reload_transient_for (MetaWindow *window,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent = meta_display_lookup_x_window (parent->display,
|
parent = meta_x11_display_lookup_x_window (parent->display->x11_display,
|
||||||
parent->xtransient_for);
|
parent->xtransient_for);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1663,12 +1673,13 @@ reload_transient_for (MetaWindow *window,
|
|||||||
else
|
else
|
||||||
meta_verbose ("Window %s is not transient\n", window->desc);
|
meta_verbose ("Window %s is not transient\n", window->desc);
|
||||||
|
|
||||||
if (window->xtransient_for == None || window->xtransient_for == window->screen->xroot)
|
if (window->xtransient_for == None ||
|
||||||
|
window->xtransient_for == window->display->x11_display->xroot)
|
||||||
meta_window_set_transient_for (window, NULL);
|
meta_window_set_transient_for (window, NULL);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
parent = meta_display_lookup_x_window (window->display,
|
parent = meta_x11_display_lookup_x_window (window->display->x11_display,
|
||||||
window->xtransient_for);
|
window->xtransient_for);
|
||||||
meta_window_set_transient_for (window, parent);
|
meta_window_set_transient_for (window, parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1792,8 +1803,8 @@ RELOAD_STRING (gtk_menubar_object_path, "gtk-menubar-object-path")
|
|||||||
#undef RELOAD_STRING
|
#undef RELOAD_STRING
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_display_init_window_prop_hooks:
|
* meta_x11_display_init_window_prop_hooks:
|
||||||
* @display: The #MetaDisplay
|
* @x11_display: The #MetaDX11isplay
|
||||||
*
|
*
|
||||||
* Initialises the property hooks system. Each row in the table named "hooks"
|
* Initialises the property hooks system. Each row in the table named "hooks"
|
||||||
* represents an action to take when a property is found on a newly-created
|
* represents an action to take when a property is found on a newly-created
|
||||||
@@ -1809,7 +1820,7 @@ RELOAD_STRING (gtk_menubar_object_path, "gtk-menubar-object-path")
|
|||||||
* This value may be NULL, in which case no callback will be called.
|
* This value may be NULL, in which case no callback will be called.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_display_init_window_prop_hooks (MetaDisplay *display)
|
meta_x11_display_init_window_prop_hooks (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
/* The ordering here is significant for the properties we load
|
/* The ordering here is significant for the properties we load
|
||||||
* initially: they are roughly ordered in the order we want them to
|
* initially: they are roughly ordered in the order we want them to
|
||||||
@@ -1825,54 +1836,54 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
|
|||||||
* for different types of override-redirect windows.
|
* for different types of override-redirect windows.
|
||||||
*/
|
*/
|
||||||
MetaWindowPropHooks hooks[] = {
|
MetaWindowPropHooks hooks[] = {
|
||||||
{ display->atom_WM_CLIENT_MACHINE, META_PROP_VALUE_STRING, reload_wm_client_machine, LOAD_INIT | INCLUDE_OR },
|
{ x11_display->atom_WM_CLIENT_MACHINE, META_PROP_VALUE_STRING, reload_wm_client_machine, LOAD_INIT | INCLUDE_OR },
|
||||||
{ display->atom__NET_WM_NAME, META_PROP_VALUE_UTF8, reload_net_wm_name, LOAD_INIT | INCLUDE_OR },
|
{ x11_display->atom__NET_WM_NAME, META_PROP_VALUE_UTF8, reload_net_wm_name, LOAD_INIT | INCLUDE_OR },
|
||||||
{ XA_WM_CLASS, META_PROP_VALUE_CLASS_HINT, reload_wm_class, LOAD_INIT | INCLUDE_OR },
|
{ XA_WM_CLASS, META_PROP_VALUE_CLASS_HINT, reload_wm_class, LOAD_INIT | INCLUDE_OR },
|
||||||
{ display->atom__NET_WM_PID, META_PROP_VALUE_CARDINAL, reload_net_wm_pid, LOAD_INIT | INCLUDE_OR },
|
{ x11_display->atom__NET_WM_PID, META_PROP_VALUE_CARDINAL, reload_net_wm_pid, LOAD_INIT | INCLUDE_OR },
|
||||||
{ XA_WM_NAME, META_PROP_VALUE_TEXT_PROPERTY, reload_wm_name, LOAD_INIT | INCLUDE_OR },
|
{ XA_WM_NAME, META_PROP_VALUE_TEXT_PROPERTY, reload_wm_name, LOAD_INIT | INCLUDE_OR },
|
||||||
{ display->atom__MUTTER_HINTS, META_PROP_VALUE_TEXT_PROPERTY, reload_mutter_hints, LOAD_INIT | INCLUDE_OR },
|
{ x11_display->atom__MUTTER_HINTS, META_PROP_VALUE_TEXT_PROPERTY, reload_mutter_hints, LOAD_INIT | INCLUDE_OR },
|
||||||
{ display->atom__NET_WM_OPAQUE_REGION, META_PROP_VALUE_CARDINAL_LIST, reload_opaque_region, LOAD_INIT | INCLUDE_OR },
|
{ x11_display->atom__NET_WM_OPAQUE_REGION, META_PROP_VALUE_CARDINAL_LIST, reload_opaque_region, LOAD_INIT | INCLUDE_OR },
|
||||||
{ display->atom__NET_WM_DESKTOP, META_PROP_VALUE_CARDINAL, reload_net_wm_desktop, LOAD_INIT | INIT_ONLY },
|
{ x11_display->atom__NET_WM_DESKTOP, META_PROP_VALUE_CARDINAL, reload_net_wm_desktop, LOAD_INIT | INIT_ONLY },
|
||||||
{ display->atom__NET_STARTUP_ID, META_PROP_VALUE_UTF8, reload_net_startup_id, LOAD_INIT },
|
{ x11_display->atom__NET_STARTUP_ID, META_PROP_VALUE_UTF8, reload_net_startup_id, LOAD_INIT },
|
||||||
{ display->atom__NET_WM_SYNC_REQUEST_COUNTER, META_PROP_VALUE_SYNC_COUNTER_LIST, reload_update_counter, LOAD_INIT | INCLUDE_OR },
|
{ x11_display->atom__NET_WM_SYNC_REQUEST_COUNTER, META_PROP_VALUE_SYNC_COUNTER_LIST, reload_update_counter, LOAD_INIT | INCLUDE_OR },
|
||||||
{ XA_WM_NORMAL_HINTS, META_PROP_VALUE_SIZE_HINTS, reload_normal_hints, LOAD_INIT },
|
{ XA_WM_NORMAL_HINTS, META_PROP_VALUE_SIZE_HINTS, reload_normal_hints, LOAD_INIT },
|
||||||
{ display->atom_WM_PROTOCOLS, META_PROP_VALUE_ATOM_LIST, reload_wm_protocols, LOAD_INIT },
|
{ x11_display->atom_WM_PROTOCOLS, META_PROP_VALUE_ATOM_LIST, reload_wm_protocols, LOAD_INIT },
|
||||||
{ XA_WM_HINTS, META_PROP_VALUE_WM_HINTS, reload_wm_hints, LOAD_INIT },
|
{ XA_WM_HINTS, META_PROP_VALUE_WM_HINTS, reload_wm_hints, LOAD_INIT },
|
||||||
{ display->atom__NET_WM_USER_TIME, META_PROP_VALUE_CARDINAL, reload_net_wm_user_time, LOAD_INIT },
|
{ x11_display->atom__NET_WM_USER_TIME, META_PROP_VALUE_CARDINAL, reload_net_wm_user_time, LOAD_INIT },
|
||||||
{ display->atom__NET_WM_STATE, META_PROP_VALUE_ATOM_LIST, reload_net_wm_state, LOAD_INIT | INIT_ONLY },
|
{ x11_display->atom__NET_WM_STATE, META_PROP_VALUE_ATOM_LIST, reload_net_wm_state, LOAD_INIT | INIT_ONLY },
|
||||||
{ display->atom__MOTIF_WM_HINTS, META_PROP_VALUE_MOTIF_HINTS, reload_mwm_hints, LOAD_INIT },
|
{ x11_display->atom__MOTIF_WM_HINTS, META_PROP_VALUE_MOTIF_HINTS, reload_mwm_hints, LOAD_INIT },
|
||||||
{ XA_WM_TRANSIENT_FOR, META_PROP_VALUE_WINDOW, reload_transient_for, LOAD_INIT },
|
{ XA_WM_TRANSIENT_FOR, META_PROP_VALUE_WINDOW, reload_transient_for, LOAD_INIT },
|
||||||
{ display->atom__GTK_THEME_VARIANT, META_PROP_VALUE_UTF8, reload_gtk_theme_variant, LOAD_INIT },
|
{ x11_display->atom__GTK_THEME_VARIANT, META_PROP_VALUE_UTF8, reload_gtk_theme_variant, LOAD_INIT },
|
||||||
{ display->atom__GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED, META_PROP_VALUE_CARDINAL, reload_gtk_hide_titlebar_when_maximized, LOAD_INIT },
|
{ x11_display->atom__GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED, META_PROP_VALUE_CARDINAL, reload_gtk_hide_titlebar_when_maximized, LOAD_INIT },
|
||||||
{ display->atom__GTK_APPLICATION_ID, META_PROP_VALUE_UTF8, reload_gtk_application_id, LOAD_INIT },
|
{ x11_display->atom__GTK_APPLICATION_ID, META_PROP_VALUE_UTF8, reload_gtk_application_id, LOAD_INIT },
|
||||||
{ display->atom__GTK_UNIQUE_BUS_NAME, META_PROP_VALUE_UTF8, reload_gtk_unique_bus_name, LOAD_INIT },
|
{ x11_display->atom__GTK_UNIQUE_BUS_NAME, META_PROP_VALUE_UTF8, reload_gtk_unique_bus_name, LOAD_INIT },
|
||||||
{ display->atom__GTK_APPLICATION_OBJECT_PATH, META_PROP_VALUE_UTF8, reload_gtk_application_object_path, LOAD_INIT },
|
{ x11_display->atom__GTK_APPLICATION_OBJECT_PATH, META_PROP_VALUE_UTF8, reload_gtk_application_object_path, LOAD_INIT },
|
||||||
{ display->atom__GTK_WINDOW_OBJECT_PATH, META_PROP_VALUE_UTF8, reload_gtk_window_object_path, LOAD_INIT },
|
{ x11_display->atom__GTK_WINDOW_OBJECT_PATH, META_PROP_VALUE_UTF8, reload_gtk_window_object_path, LOAD_INIT },
|
||||||
{ display->atom__GTK_APP_MENU_OBJECT_PATH, META_PROP_VALUE_UTF8, reload_gtk_app_menu_object_path, LOAD_INIT },
|
{ x11_display->atom__GTK_APP_MENU_OBJECT_PATH, META_PROP_VALUE_UTF8, reload_gtk_app_menu_object_path, LOAD_INIT },
|
||||||
{ display->atom__GTK_MENUBAR_OBJECT_PATH, META_PROP_VALUE_UTF8, reload_gtk_menubar_object_path, LOAD_INIT },
|
{ x11_display->atom__GTK_MENUBAR_OBJECT_PATH, META_PROP_VALUE_UTF8, reload_gtk_menubar_object_path, LOAD_INIT },
|
||||||
{ display->atom__GTK_FRAME_EXTENTS, META_PROP_VALUE_CARDINAL_LIST,reload_gtk_frame_extents, LOAD_INIT },
|
{ x11_display->atom__GTK_FRAME_EXTENTS, META_PROP_VALUE_CARDINAL_LIST,reload_gtk_frame_extents, LOAD_INIT },
|
||||||
{ display->atom__NET_WM_USER_TIME_WINDOW, META_PROP_VALUE_WINDOW, reload_net_wm_user_time_window, LOAD_INIT },
|
{ x11_display->atom__NET_WM_USER_TIME_WINDOW, META_PROP_VALUE_WINDOW, reload_net_wm_user_time_window, LOAD_INIT },
|
||||||
{ display->atom__NET_WM_ICON, META_PROP_VALUE_INVALID, reload_net_wm_icon, NONE },
|
{ x11_display->atom__NET_WM_ICON, META_PROP_VALUE_INVALID, reload_net_wm_icon, NONE },
|
||||||
{ display->atom__KWM_WIN_ICON, META_PROP_VALUE_INVALID, reload_kwm_win_icon, NONE },
|
{ x11_display->atom__KWM_WIN_ICON, META_PROP_VALUE_INVALID, reload_kwm_win_icon, NONE },
|
||||||
{ display->atom__NET_WM_ICON_GEOMETRY, META_PROP_VALUE_CARDINAL_LIST, reload_icon_geometry, LOAD_INIT },
|
{ x11_display->atom__NET_WM_ICON_GEOMETRY, META_PROP_VALUE_CARDINAL_LIST, reload_icon_geometry, LOAD_INIT },
|
||||||
{ display->atom_WM_CLIENT_LEADER, META_PROP_VALUE_INVALID, complain_about_broken_client, NONE },
|
{ x11_display->atom_WM_CLIENT_LEADER, META_PROP_VALUE_INVALID, complain_about_broken_client, NONE },
|
||||||
{ display->atom_SM_CLIENT_ID, META_PROP_VALUE_INVALID, complain_about_broken_client, NONE },
|
{ x11_display->atom_SM_CLIENT_ID, META_PROP_VALUE_INVALID, complain_about_broken_client, NONE },
|
||||||
{ display->atom_WM_WINDOW_ROLE, META_PROP_VALUE_STRING, reload_wm_window_role, LOAD_INIT | FORCE_INIT },
|
{ x11_display->atom_WM_WINDOW_ROLE, META_PROP_VALUE_STRING, reload_wm_window_role, LOAD_INIT | FORCE_INIT },
|
||||||
{ display->atom__NET_WM_WINDOW_TYPE, META_PROP_VALUE_ATOM_LIST, reload_net_wm_window_type, LOAD_INIT | INCLUDE_OR | FORCE_INIT },
|
{ x11_display->atom__NET_WM_WINDOW_TYPE, META_PROP_VALUE_ATOM_LIST, reload_net_wm_window_type, LOAD_INIT | INCLUDE_OR | FORCE_INIT },
|
||||||
{ display->atom__NET_WM_STRUT, META_PROP_VALUE_INVALID, reload_struts, NONE },
|
{ x11_display->atom__NET_WM_STRUT, META_PROP_VALUE_INVALID, reload_struts, NONE },
|
||||||
{ display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID, reload_struts, NONE },
|
{ x11_display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID, reload_struts, NONE },
|
||||||
{ display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_bypass_compositor, LOAD_INIT | INCLUDE_OR },
|
{ x11_display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_bypass_compositor, LOAD_INIT | INCLUDE_OR },
|
||||||
{ display->atom__NET_WM_WINDOW_OPACITY, META_PROP_VALUE_CARDINAL, reload_window_opacity, LOAD_INIT | INCLUDE_OR },
|
{ x11_display->atom__NET_WM_WINDOW_OPACITY, META_PROP_VALUE_CARDINAL, reload_window_opacity, LOAD_INIT | INCLUDE_OR },
|
||||||
{ 0 },
|
{ 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
MetaWindowPropHooks *table = g_memdup (hooks, sizeof (hooks)),
|
MetaWindowPropHooks *table = g_memdup (hooks, sizeof (hooks)),
|
||||||
*cursor = table;
|
*cursor = table;
|
||||||
|
|
||||||
g_assert (display->prop_hooks == NULL);
|
g_assert (x11_display->prop_hooks == NULL);
|
||||||
|
|
||||||
display->prop_hooks_table = (gpointer) table;
|
x11_display->prop_hooks_table = (gpointer) table;
|
||||||
display->prop_hooks = g_hash_table_new (NULL, NULL);
|
x11_display->prop_hooks = g_hash_table_new (NULL, NULL);
|
||||||
|
|
||||||
while (cursor->property)
|
while (cursor->property)
|
||||||
{
|
{
|
||||||
@@ -1886,28 +1897,28 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
|
|||||||
* anything 32 bits or less, and atoms are 32 bits with the top three
|
* anything 32 bits or less, and atoms are 32 bits with the top three
|
||||||
* bits clear. (Scheifler & Gettys, 2e, p372)
|
* bits clear. (Scheifler & Gettys, 2e, p372)
|
||||||
*/
|
*/
|
||||||
g_hash_table_insert (display->prop_hooks,
|
g_hash_table_insert (x11_display->prop_hooks,
|
||||||
GINT_TO_POINTER (cursor->property),
|
GINT_TO_POINTER (cursor->property),
|
||||||
cursor);
|
cursor);
|
||||||
cursor++;
|
cursor++;
|
||||||
}
|
}
|
||||||
display->n_prop_hooks = cursor - table;
|
x11_display->n_prop_hooks = cursor - table;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_display_free_window_prop_hooks (MetaDisplay *display)
|
meta_x11_display_free_window_prop_hooks (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
g_hash_table_unref (display->prop_hooks);
|
g_hash_table_unref (x11_display->prop_hooks);
|
||||||
display->prop_hooks = NULL;
|
x11_display->prop_hooks = NULL;
|
||||||
|
|
||||||
g_free (display->prop_hooks_table);
|
g_free (x11_display->prop_hooks_table);
|
||||||
display->prop_hooks_table = NULL;
|
x11_display->prop_hooks_table = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static MetaWindowPropHooks*
|
static MetaWindowPropHooks *
|
||||||
find_hooks (MetaDisplay *display,
|
find_hooks (MetaX11Display *x11_display,
|
||||||
Atom property)
|
Atom property)
|
||||||
{
|
{
|
||||||
return g_hash_table_lookup (display->prop_hooks,
|
return g_hash_table_lookup (x11_display->prop_hooks,
|
||||||
GINT_TO_POINTER (property));
|
GINT_TO_POINTER (property));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,22 +60,22 @@ void meta_window_reload_property_from_xwindow (MetaWindow *window,
|
|||||||
void meta_window_load_initial_properties (MetaWindow *window);
|
void meta_window_load_initial_properties (MetaWindow *window);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_display_init_window_prop_hooks:
|
* meta_x11_display_init_window_prop_hooks:
|
||||||
* @display: The display.
|
* @x11_display: The X11 display.
|
||||||
*
|
*
|
||||||
* Initialises the hooks used for the reload_propert* functions
|
* Initialises the hooks used for the reload_propert* functions
|
||||||
* on a particular display, and stores a pointer to them in the
|
* on a particular display, and stores a pointer to them in the
|
||||||
* display.
|
* x11_display.
|
||||||
*/
|
*/
|
||||||
void meta_display_init_window_prop_hooks (MetaDisplay *display);
|
void meta_x11_display_init_window_prop_hooks (MetaX11Display *x11_display);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_display_free_window_prop_hooks:
|
* meta_x11_display_free_window_prop_hooks:
|
||||||
* @display: The display.
|
* @x11_display: The X11 display.
|
||||||
* Frees the hooks used for the reload_propert* functions
|
* Frees the hooks used for the reload_propert* functions
|
||||||
* for a particular display.
|
* for a particular display.
|
||||||
*/
|
*/
|
||||||
void meta_display_free_window_prop_hooks (MetaDisplay *display);
|
void meta_x11_display_free_window_prop_hooks (MetaX11Display *x11_display);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_set_normal_hints:
|
* meta_set_normal_hints:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user