Stop using MetaScreen where it is unnecessary

https://bugzilla.gnome.org/show_bug.cgi?id=759538
This commit is contained in:
Armin Krezović 2017-08-26 21:43:17 +02:00 committed by Jonas Ådahl
parent b7c3dada81
commit 1d5e37050d
38 changed files with 187 additions and 366 deletions

View File

@ -27,7 +27,6 @@
#include <glib-object.h> #include <glib-object.h>
#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 ())

View File

@ -162,15 +162,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);

View File

@ -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>

View File

@ -26,6 +26,7 @@
#define META_CURSOR_RENDERER_NATIVE_H #define META_CURSOR_RENDERER_NATIVE_H
#include "meta-cursor-renderer.h" #include "meta-cursor-renderer.h"
#include "meta/meta-backend.h"
#define META_TYPE_CURSOR_RENDERER_NATIVE (meta_cursor_renderer_native_get_type ()) #define META_TYPE_CURSOR_RENDERER_NATIVE (meta_cursor_renderer_native_get_type ())
G_DECLARE_FINAL_TYPE (MetaCursorRendererNative, meta_cursor_renderer_native, G_DECLARE_FINAL_TYPE (MetaCursorRendererNative, meta_cursor_renderer_native,

View File

@ -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,7 +55,6 @@
#include <clutter/x11/clutter-x11.h> #include <clutter/x11/clutter-x11.h>
#include "core.h" #include "core.h"
#include <meta/screen.h>
#include <meta/errors.h> #include <meta/errors.h>
#include <meta/window.h> #include <meta/window.h>
#include "compositor-private.h" #include "compositor-private.h"
@ -151,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
@ -232,7 +231,6 @@ 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_x11_display_get_xdisplay (display->x11_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));
@ -249,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. */
@ -257,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_x11_display_get_xdisplay (display->x11_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;
@ -281,13 +278,13 @@ meta_focus_stage_window (MetaScreen *screen,
if (window == None) if (window == None)
return; return;
meta_x11_display_set_input_focus_xwindow (screen->display->x11_display, meta_x11_display_set_input_focus_xwindow (display->x11_display,
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;
@ -295,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;
@ -304,7 +301,7 @@ meta_stage_is_focused (MetaScreen *screen)
if (window == None) if (window == None)
return FALSE; return FALSE;
return (screen->display->x11_display->focus_xwindow == window); return (display->x11_display->focus_xwindow == window);
} }
static gboolean static gboolean
@ -381,7 +378,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 ())
@ -408,7 +405,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;
@ -446,9 +443,8 @@ after_stage_paint (ClutterStage *stage,
} }
static void static void
redirect_windows (MetaScreen *screen) redirect_windows (MetaDisplay *display)
{ {
MetaDisplay *display = meta_screen_get_display (screen);
MetaX11Display *x11_display = meta_display_get_x11_display (display); MetaX11Display *x11_display = meta_display_get_x11_display (display);
Display *xdisplay = meta_x11_display_get_xdisplay (x11_display); Display *xdisplay = meta_x11_display_get_xdisplay (x11_display);
Window xroot = meta_x11_display_get_xroot (x11_display); Window xroot = meta_x11_display_get_xroot (x11_display);
@ -494,7 +490,6 @@ meta_compositor_manage (MetaCompositor *compositor)
{ {
MetaDisplay *display = compositor->display; MetaDisplay *display = compositor->display;
Display *xdisplay = display->x11_display->xdisplay; Display *xdisplay = display->x11_display->xdisplay;
MetaScreen *screen = display->screen;
MetaBackend *backend = meta_get_backend (); MetaBackend *backend = meta_get_backend ();
meta_x11_display_set_cm_selection (display->x11_display); meta_x11_display_set_cm_selection (display->x11_display);
@ -518,9 +513,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);
@ -543,7 +538,7 @@ meta_compositor_manage (MetaCompositor *compositor)
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
@ -563,7 +558,7 @@ 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); redirect_windows (display);
compositor->plugin_mgr = meta_plugin_manager_new (compositor); compositor->plugin_mgr = meta_plugin_manager_new (compositor);
} }
@ -1265,44 +1260,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--;
} }
@ -1319,15 +1314,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 ();

View File

@ -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);

View File

@ -86,7 +86,7 @@
enum enum
{ {
PROP_META_SCREEN = 1, PROP_META_DISPLAY = 1,
PROP_MONITOR, PROP_MONITOR,
PROP_BACKGROUND, PROP_BACKGROUND,
PROP_GRADIENT, PROP_GRADIENT,
@ -151,7 +151,7 @@ typedef enum {
struct _MetaBackgroundActorPrivate struct _MetaBackgroundActorPrivate
{ {
MetaScreen *screen; MetaDisplay *display;
int monitor; int monitor;
MetaBackground *background; MetaBackground *background;
@ -214,7 +214,7 @@ 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_display_get_monitor_geometry (meta_screen_get_display (priv->screen), meta_display_get_monitor_geometry (priv->display,
priv->monitor, priv->monitor,
&monitor_geometry); &monitor_geometry);
@ -384,7 +384,7 @@ setup_pipeline (MetaBackgroundActor *self,
MetaRectangle monitor_geometry; MetaRectangle monitor_geometry;
float gradient_height_perc; float gradient_height_perc;
meta_display_get_monitor_geometry (meta_screen_get_display (priv->screen), meta_display_get_monitor_geometry (priv->display,
priv->monitor, &monitor_geometry); priv->monitor, &monitor_geometry);
gradient_height_perc = MAX (0.0001, priv->gradient_height / (float)monitor_geometry.height); gradient_height_perc = MAX (0.0001, priv->gradient_height / (float)monitor_geometry.height);
cogl_pipeline_set_uniform_1f (priv->pipeline, cogl_pipeline_set_uniform_1f (priv->pipeline,
@ -552,8 +552,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:
meta_background_actor_set_monitor (self, g_value_get_int (value)); meta_background_actor_set_monitor (self, g_value_get_int (value));
@ -613,8 +613,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);
@ -664,14 +664,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",
@ -782,13 +782,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);
@ -927,7 +927,7 @@ meta_background_actor_set_monitor (MetaBackgroundActor *self,
MetaBackgroundActorPrivate *priv = self->priv; MetaBackgroundActorPrivate *priv = self->priv;
MetaRectangle old_monitor_geometry; MetaRectangle old_monitor_geometry;
MetaRectangle new_monitor_geometry; MetaRectangle new_monitor_geometry;
MetaDisplay *display = meta_screen_get_display (priv->screen); MetaDisplay *display = priv->display;
if(priv->monitor == monitor) if(priv->monitor == monitor)
return; return;

View File

@ -26,9 +26,6 @@
#include <string.h> #include <string.h>
// XXX: Remove this once transition to MetaDisplay has been completed
#include "core/display-private.h"
enum enum
{ {
CHANGED, CHANGED,

View File

@ -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 {

View File

@ -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

View File

@ -5,7 +5,7 @@
#include <meta/meta-window-group.h> #include <meta/meta-window-group.h>
#include <meta/screen.h> #include <meta/display.h>
/** /**
* MetaWindowGroup: * MetaWindowGroup:
@ -19,6 +19,6 @@
typedef struct _MetaWindowGroupPrivate MetaWindowGroupPrivate; typedef struct _MetaWindowGroupPrivate MetaWindowGroupPrivate;
ClutterActor *meta_window_group_new (MetaScreen *screen); ClutterActor *meta_window_group_new (MetaDisplay *display);
#endif /* META_WINDOW_GROUP_PRIVATE_H */ #endif /* META_WINDOW_GROUP_PRIVATE_H */

View File

@ -24,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);
@ -65,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_display_get_size (window_group->screen->display, &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
@ -200,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);
} }

View File

@ -33,16 +33,13 @@
#include <gmodule.h> #include <gmodule.h>
#include <string.h> #include <string.h>
// XXX: Remove this once transition to MetaDisplay has been completed
#include "core/display-private.h"
#define DESTROY_TIMEOUT 100 #define DESTROY_TIMEOUT 100
#define MINIMIZE_TIMEOUT 250 #define MINIMIZE_TIMEOUT 250
#define MAP_TIMEOUT 250 #define MAP_TIMEOUT 250
#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))
@ -71,7 +68,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,
@ -138,14 +135,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)
@ -289,8 +286,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)
{ {
@ -325,14 +322,13 @@ static void
on_monitors_changed (MetaDisplay *display, on_monitors_changed (MetaDisplay *display,
MetaPlugin *plugin) MetaPlugin *plugin)
{ {
MetaScreen *screen = display->screen;
MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (plugin); MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (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_display_get_n_monitors (meta_screen_get_display (screen)); n = meta_display_get_n_monitors (display);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
MetaRectangle rect; MetaRectangle rect;
@ -340,10 +336,9 @@ on_monitors_changed (MetaDisplay *display,
MetaBackground *background; MetaBackground *background;
ClutterColor color; ClutterColor color;
meta_display_get_monitor_geometry (meta_screen_get_display (screen), meta_display_get_monitor_geometry (display, i, &rect);
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);
@ -378,18 +373,18 @@ 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);
MetaDisplay *display = meta_screen_get_display (screen);
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 (display, "monitors-changed", g_signal_connect (display, "monitors-changed",
G_CALLBACK (on_monitors_changed), plugin); G_CALLBACK (on_monitors_changed), plugin);
on_monitors_changed (display, plugin); on_monitors_changed (display, plugin);
clutter_actor_show (meta_get_stage_for_screen (screen)); clutter_actor_show (meta_get_stage_for_display (display));
} }
static void static void
@ -397,7 +392,6 @@ switch_workspace (MetaPlugin *plugin,
gint from, gint to, gint from, gint to,
MetaMotionDirection direction) MetaMotionDirection direction)
{ {
MetaScreen *screen;
MetaDisplay *display; MetaDisplay *display;
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv; MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
GList *l; GList *l;
@ -406,9 +400,8 @@ 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);
display = meta_screen_get_display (screen); stage = meta_get_stage_for_display (display);
stage = meta_get_stage_for_screen (screen);
meta_display_get_size (display, meta_display_get_size (display,
&screen_width, &screen_width,
@ -430,7 +423,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)
{ {
@ -678,36 +671,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;
@ -719,8 +712,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)
@ -746,8 +739,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);
} }

View File

@ -49,7 +49,6 @@
#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"
@ -74,7 +73,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);
} }
/** /**

View File

@ -220,14 +220,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,

View File

@ -147,7 +147,6 @@ struct _MetaDisplay
guint focused_by_us : 1; guint focused_by_us : 1;
/*< private-ish >*/ /*< private-ish >*/
MetaScreen *screen;
GHashTable *stamps; GHashTable *stamps;
GHashTable *wayland_windows; GHashTable *wayland_windows;

View File

@ -35,7 +35,6 @@
#include "events.h" #include "events.h"
#include "util-private.h" #include "util-private.h"
#include <meta/main.h> #include <meta/main.h>
#include "screen-private.h"
#include "window-private.h" #include "window-private.h"
#include "boxes-private.h" #include "boxes-private.h"
#include "frame.h" #include "frame.h"
@ -317,7 +316,7 @@ meta_display_class_init (MetaDisplayClass *klass)
0, 0,
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_NONE, 3,
META_TYPE_SCREEN, META_TYPE_DISPLAY,
META_TYPE_WINDOW, META_TYPE_WINDOW,
META_TYPE_GRAB_OP); META_TYPE_GRAB_OP);
@ -328,7 +327,7 @@ meta_display_class_init (MetaDisplayClass *klass)
0, 0,
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_NONE, 3,
META_TYPE_SCREEN, META_TYPE_DISPLAY,
META_TYPE_WINDOW, META_TYPE_WINDOW,
META_TYPE_GRAB_OP); META_TYPE_GRAB_OP);
@ -709,7 +708,6 @@ meta_display_open (void)
GError *error = NULL; GError *error = NULL;
MetaDisplay *display; MetaDisplay *display;
MetaX11Display *x11_display; MetaX11Display *x11_display;
MetaScreen *screen;
int i; int i;
guint32 timestamp; guint32 timestamp;
Window old_active_xwindow = None; Window old_active_xwindow = None;
@ -726,7 +724,6 @@ meta_display_open (void)
display->autoraise_timeout_id = 0; display->autoraise_timeout_id = 0;
display->autoraise_window = NULL; display->autoraise_window = NULL;
display->focus_window = NULL; display->focus_window = NULL;
display->screen = NULL;
display->x11_display = NULL; display->x11_display = NULL;
display->rect.x = display->rect.y = 0; display->rect.x = display->rect.y = 0;
@ -815,23 +812,6 @@ meta_display_open (void)
display->last_user_time = timestamp; display->last_user_time = timestamp;
display->compositor = NULL; display->compositor = NULL;
/* Mutter used to manage all X screens of the display in a single process, but
* now it always manages exactly one screen - the default screen retrieved
* from GDK.
*/
screen = meta_screen_new (display, timestamp);
if (!screen)
{
/* This would typically happen because all the screens already
* have window managers.
*/
meta_display_close (display, timestamp);
return FALSE;
}
display->screen = screen;
if (!meta_is_wayland_compositor ()) if (!meta_is_wayland_compositor ())
meta_prop_get_window (display->x11_display, meta_prop_get_window (display->x11_display,
display->x11_display->xroot, display->x11_display->xroot,
@ -1031,10 +1011,6 @@ meta_display_close (MetaDisplay *display,
/* Stop caring about events */ /* Stop caring about events */
meta_display_free_events (display); meta_display_free_events (display);
if (display->screen)
meta_screen_free (display->screen, timestamp);
display->screen = NULL;
/* Must be after all calls to meta_window_unmanage() since they /* Must be after all calls to meta_window_unmanage() since they
* unregister windows * unregister windows
*/ */
@ -1691,7 +1667,6 @@ get_event_route_from_grab_op (MetaGrabOp op)
gboolean gboolean
meta_display_begin_grab_op (MetaDisplay *display, 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,
@ -1821,7 +1796,7 @@ meta_display_begin_grab_op (MetaDisplay *display,
} }
g_signal_emit (display, display_signals[GRAB_OP_BEGIN], 0, g_signal_emit (display, display_signals[GRAB_OP_BEGIN], 0,
screen, display->grab_window, display->grab_op); display, display->grab_window, display->grab_op);
if (display->event_route == META_EVENT_ROUTE_WINDOW_OP) if (display->event_route == META_EVENT_ROUTE_WINDOW_OP)
meta_window_grab_op_began (display->grab_window, display->grab_op); meta_window_grab_op_began (display->grab_window, display->grab_op);
@ -1846,7 +1821,7 @@ meta_display_end_grab_op (MetaDisplay *display,
g_assert (grab_window != NULL); g_assert (grab_window != NULL);
g_signal_emit (display, display_signals[GRAB_OP_END], 0, g_signal_emit (display, display_signals[GRAB_OP_END], 0,
display->screen, grab_window, grab_op); display, grab_window, grab_op);
/* We need to reset this early, since the /* We need to reset this early, since the
* meta_window_grab_op_ended callback relies on this being * meta_window_grab_op_ended callback relies on this being
@ -2457,17 +2432,6 @@ meta_resize_gravity_from_grab_op (MetaGrabOp op)
return gravity; return gravity;
} }
void
meta_display_unmanage_screen (MetaDisplay *display,
MetaScreen *screen,
guint32 timestamp)
{
meta_verbose ("Unmanaging screen %d on display %s\n",
meta_ui_get_screen_number (),
display->x11_display->name);
meta_display_close (display, timestamp);
}
void void
meta_display_manage_all_windows (MetaDisplay *display) meta_display_manage_all_windows (MetaDisplay *display)
{ {

View File

@ -34,7 +34,6 @@
#include <meta/errors.h> #include <meta/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"
@ -170,17 +169,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);
@ -1584,7 +1580,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,
@ -1861,21 +1856,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,
@ -1885,7 +1879,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)
{ {
@ -1935,7 +1928,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;
@ -1947,7 +1940,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)
{ {
@ -1988,7 +1980,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
@ -2073,7 +2065,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;
@ -2117,20 +2108,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;
} }
@ -2164,20 +2150,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)
@ -2187,7 +2173,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
@ -2229,7 +2215,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)
{ {
@ -2278,7 +2263,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)
{ {
@ -2395,7 +2379,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)
{ {
@ -2516,7 +2499,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)
{ {
@ -2551,7 +2533,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;
@ -2746,7 +2728,6 @@ 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,
@ -2759,7 +2740,6 @@ handle_switch_to_last_workspace (MetaDisplay *display,
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,
@ -2795,7 +2775,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,
@ -2812,7 +2791,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,
@ -2829,7 +2807,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,
@ -2843,7 +2820,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)
{ {
@ -2902,95 +2878,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,
@ -3010,7 +2977,6 @@ 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,
@ -3029,7 +2995,6 @@ handle_show_desktop (MetaDisplay *display,
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,
@ -3082,7 +3047,6 @@ handle_panel (MetaDisplay *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,
@ -3108,7 +3072,6 @@ 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,
@ -3132,31 +3095,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,
@ -3170,7 +3130,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,
@ -3184,7 +3143,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,
@ -3221,7 +3179,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,
@ -3235,7 +3192,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,
@ -3247,7 +3203,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,
@ -3259,7 +3214,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,
@ -3273,7 +3227,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,
@ -3285,7 +3238,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,
@ -3297,7 +3249,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,
@ -3314,7 +3265,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,
@ -3331,7 +3281,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,
@ -3345,7 +3294,6 @@ 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,
@ -3365,7 +3313,6 @@ handle_move_to_workspace_last (MetaDisplay *display,
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,
@ -3420,7 +3367,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,
@ -3444,7 +3390,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,
@ -3491,7 +3436,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,
@ -3502,7 +3446,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,
@ -3513,7 +3456,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,
@ -3525,7 +3467,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,
@ -3544,7 +3485,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,
@ -3565,7 +3505,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,
@ -3580,7 +3519,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,

View File

@ -491,8 +491,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)
@ -553,7 +551,6 @@ create_constraints (Constraint **constraints,
MetaWindow *group_window = tmp2->data; MetaWindow *group_window = tmp2->data;
if (!meta_window_is_in_stack (group_window) || if (!meta_window_is_in_stack (group_window) ||
w->screen != group_window->screen ||
group_window->override_redirect) group_window->override_redirect)
{ {
tmp2 = tmp2->next; tmp2 = tmp2->next;
@ -1281,8 +1278,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 */

View File

@ -29,7 +29,6 @@
#include <meta/errors.h> #include <meta/errors.h>
#include "display-private.h" #include "display-private.h"
#include "x11/meta-x11-display-private.h" #include "x11/meta-x11-display-private.h"
#include "screen-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

View File

@ -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>
@ -145,7 +145,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;
@ -586,7 +585,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,

View File

@ -922,7 +922,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,
@ -961,9 +960,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);
@ -974,8 +970,6 @@ _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_sandboxed_app_id (window); meta_window_update_sandboxed_app_id (window);
meta_window_update_desc (window); meta_window_update_desc (window);
@ -1314,7 +1308,7 @@ _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 */
@ -1433,7 +1427,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)
@ -1740,9 +1734,6 @@ 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 0; /* don't care how they sort with respect to each other */
else
return meta_stack_windows_cmp (aw->display->stack, return meta_stack_windows_cmp (aw->display->stack,
aw, bw); aw, bw);
} }
@ -3200,11 +3191,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
@ -3219,6 +3207,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
@ -6817,7 +6806,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,
@ -7200,20 +7188,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
@ -8303,7 +8277,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,
@ -8327,7 +8300,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,

View File

@ -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

View File

@ -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,

View File

@ -104,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,
@ -144,10 +143,6 @@ GSList *meta_display_sort_windows_by_stacking (MetaDisplay *display,
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,

View File

@ -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,7 +60,7 @@ 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,

View File

@ -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:

View File

@ -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,

View File

@ -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);

View File

@ -384,7 +384,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 +391,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,

View File

@ -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);

View File

@ -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))

View File

@ -26,7 +26,6 @@
#include "meta-wayland-cursor-surface.h" #include "meta-wayland-cursor-surface.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"

View File

@ -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 */

View File

@ -1273,7 +1273,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 */

View File

@ -594,7 +594,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;
/* /*
@ -620,7 +619,6 @@ meta_window_wayland_new (MetaDisplay *display,
*/ */
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,

View File

@ -1160,8 +1160,7 @@ process_selection_clear (MetaX11Display *x11_display,
meta_verbose ("Got selection clear for on display %s\n", meta_verbose ("Got selection clear for on display %s\n",
x11_display->name); x11_display->name);
meta_display_unmanage_screen (x11_display->display, meta_display_close (x11_display->display,
x11_display->display->screen,
event->xselectionclear.time); event->xselectionclear.time);
return TRUE; return TRUE;
} }

View File

@ -2316,7 +2316,7 @@ meta_window_x11_property_notify (MetaWindow *window,
static int static int
query_pressed_buttons (MetaWindow *window) query_pressed_buttons (MetaWindow *window)
{ {
MetaCursorTracker *tracker = meta_cursor_tracker_get_for_screen (window->screen); MetaCursorTracker *tracker = meta_cursor_tracker_get_for_display (window->display);
ClutterModifierType mods; ClutterModifierType mods;
int button = 0; int button = 0;
@ -2705,7 +2705,6 @@ meta_window_x11_client_message (MetaWindow *window,
meta_topic (META_DEBUG_WINDOW_OPS, meta_topic (META_DEBUG_WINDOW_OPS,
"Beginning move/resize with button = %d\n", button); "Beginning move/resize with button = %d\n", button);
meta_display_begin_grab_op (window->display, meta_display_begin_grab_op (window->display,
window->screen,
window, window,
op, op,
FALSE, FALSE,
@ -3032,7 +3031,6 @@ meta_window_x11_new (MetaDisplay *display,
MetaCompEffect effect) MetaCompEffect effect)
{ {
MetaX11Display *x11_display = display->x11_display; MetaX11Display *x11_display = display->x11_display;
MetaScreen *screen = display->screen;
XWindowAttributes attrs; XWindowAttributes attrs;
gulong existing_wm_state; gulong existing_wm_state;
MetaWindow *window = NULL; MetaWindow *window = NULL;
@ -3170,7 +3168,6 @@ meta_window_x11_new (MetaDisplay *display,
} }
window = _meta_window_shared_new (display, window = _meta_window_shared_new (display,
screen,
META_WINDOW_CLIENT_TYPE_X11, META_WINDOW_CLIENT_TYPE_X11,
NULL, NULL,
xwindow, xwindow,