Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
27de94b915 | ||
![]() |
9e31f2b1de | ||
![]() |
13ad103823 | ||
![]() |
ff5a73de49 | ||
![]() |
275a6ec63f | ||
![]() |
604da0f6ea | ||
![]() |
72a19dd448 | ||
![]() |
3a73f6b8ec | ||
![]() |
343474a570 | ||
![]() |
91d82bf8c7 | ||
![]() |
ed19060074 | ||
![]() |
f230a67b94 |
@@ -2,7 +2,7 @@ AC_PREREQ(2.50)
|
||||
|
||||
m4_define([mutter_major_version], [2])
|
||||
m4_define([mutter_minor_version], [31])
|
||||
m4_define([mutter_micro_version], [2])
|
||||
m4_define([mutter_micro_version], [4])
|
||||
|
||||
m4_define([mutter_version],
|
||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||
|
@@ -790,7 +790,6 @@ meta_compositor_switch_workspace (MetaCompositor *compositor,
|
||||
|
||||
if (!info->plugin_mgr ||
|
||||
!mutter_plugin_manager_switch_workspace (info->plugin_mgr,
|
||||
(const GList **)&info->windows,
|
||||
from_indx,
|
||||
to_indx,
|
||||
direction))
|
||||
|
@@ -402,9 +402,8 @@ mutter_plugin_manager_get (MetaScreen *screen)
|
||||
}
|
||||
|
||||
static void
|
||||
mutter_plugin_manager_kill_effect (MutterPluginManager *plugin_mgr,
|
||||
MutterWindow *actor,
|
||||
unsigned long events)
|
||||
mutter_plugin_manager_kill_window_effects (MutterPluginManager *plugin_mgr,
|
||||
MutterWindow *actor)
|
||||
{
|
||||
GList *l = plugin_mgr->plugins;
|
||||
|
||||
@@ -414,17 +413,32 @@ mutter_plugin_manager_kill_effect (MutterPluginManager *plugin_mgr,
|
||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
||||
|
||||
if (!mutter_plugin_disabled (plugin)
|
||||
&& (mutter_plugin_features (plugin) & events)
|
||||
&& klass->kill_effect)
|
||||
klass->kill_effect (plugin, actor, events);
|
||||
&& klass->kill_window_effects)
|
||||
klass->kill_window_effects (plugin, actor);
|
||||
|
||||
l = l->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
mutter_plugin_manager_kill_switch_workspace (MutterPluginManager *plugin_mgr)
|
||||
{
|
||||
GList *l = plugin_mgr->plugins;
|
||||
|
||||
while (l)
|
||||
{
|
||||
MutterPlugin *plugin = l->data;
|
||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
||||
|
||||
if (!mutter_plugin_disabled (plugin)
|
||||
&& (mutter_plugin_features (plugin) & MUTTER_PLUGIN_SWITCH_WORKSPACE)
|
||||
&& klass->kill_switch_workspace)
|
||||
klass->kill_switch_workspace (plugin);
|
||||
|
||||
l = l->next;
|
||||
}
|
||||
}
|
||||
|
||||
#define ALL_BUT_SWITCH \
|
||||
MUTTER_PLUGIN_ALL_EFFECTS & \
|
||||
~MUTTER_PLUGIN_SWITCH_WORKSPACE
|
||||
/*
|
||||
* Public method that the compositor hooks into for events that require
|
||||
* no additional parameters.
|
||||
@@ -461,10 +475,9 @@ mutter_plugin_manager_event_simple (MutterPluginManager *plugin_mgr,
|
||||
case MUTTER_PLUGIN_MINIMIZE:
|
||||
if (klass->minimize)
|
||||
{
|
||||
mutter_plugin_manager_kill_effect (
|
||||
mutter_plugin_manager_kill_window_effects (
|
||||
plugin_mgr,
|
||||
actor,
|
||||
ALL_BUT_SWITCH);
|
||||
actor);
|
||||
|
||||
_mutter_plugin_effect_started (plugin);
|
||||
klass->minimize (plugin, actor);
|
||||
@@ -473,10 +486,9 @@ mutter_plugin_manager_event_simple (MutterPluginManager *plugin_mgr,
|
||||
case MUTTER_PLUGIN_MAP:
|
||||
if (klass->map)
|
||||
{
|
||||
mutter_plugin_manager_kill_effect (
|
||||
mutter_plugin_manager_kill_window_effects (
|
||||
plugin_mgr,
|
||||
actor,
|
||||
ALL_BUT_SWITCH);
|
||||
actor);
|
||||
|
||||
_mutter_plugin_effect_started (plugin);
|
||||
klass->map (plugin, actor);
|
||||
@@ -540,10 +552,9 @@ mutter_plugin_manager_event_maximize (MutterPluginManager *plugin_mgr,
|
||||
case MUTTER_PLUGIN_MAXIMIZE:
|
||||
if (klass->maximize)
|
||||
{
|
||||
mutter_plugin_manager_kill_effect (
|
||||
mutter_plugin_manager_kill_window_effects (
|
||||
plugin_mgr,
|
||||
actor,
|
||||
ALL_BUT_SWITCH);
|
||||
actor);
|
||||
|
||||
_mutter_plugin_effect_started (plugin);
|
||||
klass->maximize (plugin, actor,
|
||||
@@ -554,10 +565,9 @@ mutter_plugin_manager_event_maximize (MutterPluginManager *plugin_mgr,
|
||||
case MUTTER_PLUGIN_UNMAXIMIZE:
|
||||
if (klass->unmaximize)
|
||||
{
|
||||
mutter_plugin_manager_kill_effect (
|
||||
mutter_plugin_manager_kill_window_effects (
|
||||
plugin_mgr,
|
||||
actor,
|
||||
ALL_BUT_SWITCH);
|
||||
actor);
|
||||
|
||||
_mutter_plugin_effect_started (plugin);
|
||||
klass->unmaximize (plugin, actor,
|
||||
@@ -586,7 +596,6 @@ mutter_plugin_manager_event_maximize (MutterPluginManager *plugin_mgr,
|
||||
*/
|
||||
gboolean
|
||||
mutter_plugin_manager_switch_workspace (MutterPluginManager *plugin_mgr,
|
||||
const GList **actors,
|
||||
gint from,
|
||||
gint to,
|
||||
MetaMotionDirection direction)
|
||||
@@ -604,19 +613,15 @@ mutter_plugin_manager_switch_workspace (MutterPluginManager *plugin_mgr,
|
||||
MutterPluginClass *klass = MUTTER_PLUGIN_GET_CLASS (plugin);
|
||||
|
||||
if (!mutter_plugin_disabled (plugin) &&
|
||||
(mutter_plugin_features (plugin) & MUTTER_PLUGIN_SWITCH_WORKSPACE) &&
|
||||
(actors && *actors))
|
||||
(mutter_plugin_features (plugin) & MUTTER_PLUGIN_SWITCH_WORKSPACE))
|
||||
{
|
||||
if (klass->switch_workspace)
|
||||
{
|
||||
retval = TRUE;
|
||||
mutter_plugin_manager_kill_effect (
|
||||
plugin_mgr,
|
||||
MUTTER_WINDOW ((*actors)->data),
|
||||
MUTTER_PLUGIN_SWITCH_WORKSPACE);
|
||||
mutter_plugin_manager_kill_switch_workspace (plugin_mgr);
|
||||
|
||||
_mutter_plugin_effect_started (plugin);
|
||||
klass->switch_workspace (plugin, actors, from, to, direction);
|
||||
klass->switch_workspace (plugin, from, to, direction);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -31,6 +31,15 @@
|
||||
#include "mutter-plugin.h"
|
||||
#undef MUTTER_PLUGIN_FROM_MANAGER_
|
||||
|
||||
#define MUTTER_PLUGIN_MINIMIZE (1<<0)
|
||||
#define MUTTER_PLUGIN_MAXIMIZE (1<<1)
|
||||
#define MUTTER_PLUGIN_UNMAXIMIZE (1<<2)
|
||||
#define MUTTER_PLUGIN_MAP (1<<3)
|
||||
#define MUTTER_PLUGIN_DESTROY (1<<4)
|
||||
#define MUTTER_PLUGIN_SWITCH_WORKSPACE (1<<5)
|
||||
|
||||
#define MUTTER_PLUGIN_ALL_EFFECTS (~0)
|
||||
|
||||
typedef struct MutterPluginManager MutterPluginManager;
|
||||
|
||||
MutterPluginManager * mutter_plugin_manager_get (MetaScreen *screen);
|
||||
@@ -54,7 +63,6 @@ void mutter_plugin_manager_update_workspaces (MutterPluginManager *mgr);
|
||||
void mutter_plugin_manager_update_workspace (MutterPluginManager *mgr, MetaWorkspace *w);
|
||||
|
||||
gboolean mutter_plugin_manager_switch_workspace (MutterPluginManager *mgr,
|
||||
const GList **actors,
|
||||
gint from,
|
||||
gint to,
|
||||
MetaMotionDirection direction);
|
||||
|
@@ -367,9 +367,25 @@ _mutter_plugin_effect_started (MutterPlugin *plugin)
|
||||
}
|
||||
|
||||
void
|
||||
mutter_plugin_effect_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor,
|
||||
unsigned long event)
|
||||
mutter_plugin_switch_workspace_completed (MutterPlugin *plugin)
|
||||
{
|
||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
||||
|
||||
MetaScreen *screen = mutter_plugin_get_screen (plugin);
|
||||
|
||||
if (priv->running-- < 0)
|
||||
{
|
||||
g_warning ("Error in running effect accounting, adjusting.");
|
||||
priv->running = 0;
|
||||
}
|
||||
|
||||
mutter_switch_workspace_completed (screen);
|
||||
}
|
||||
|
||||
static void
|
||||
mutter_plugin_window_effect_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor,
|
||||
unsigned long event)
|
||||
{
|
||||
MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv;
|
||||
|
||||
@@ -391,17 +407,42 @@ mutter_plugin_effect_completed (MutterPlugin *plugin,
|
||||
name ? name : "unknown");
|
||||
}
|
||||
|
||||
if (event == MUTTER_PLUGIN_SWITCH_WORKSPACE)
|
||||
{
|
||||
/* The window is just used to identify the screen */
|
||||
MetaWindow *window = mutter_window_get_meta_window (actor);
|
||||
MetaScreen *screen = meta_window_get_screen (window);
|
||||
mutter_switch_workspace_completed (screen);
|
||||
}
|
||||
else
|
||||
{
|
||||
mutter_window_effect_completed (actor, event);
|
||||
}
|
||||
mutter_window_effect_completed (actor, event);
|
||||
}
|
||||
|
||||
void
|
||||
mutter_plugin_minimize_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor)
|
||||
{
|
||||
mutter_plugin_window_effect_completed (plugin, actor, MUTTER_PLUGIN_MINIMIZE);
|
||||
}
|
||||
|
||||
void
|
||||
mutter_plugin_maximize_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor)
|
||||
{
|
||||
mutter_plugin_window_effect_completed (plugin, actor, MUTTER_PLUGIN_MAXIMIZE);
|
||||
}
|
||||
|
||||
void
|
||||
mutter_plugin_unmaximize_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor)
|
||||
{
|
||||
mutter_plugin_window_effect_completed (plugin, actor, MUTTER_PLUGIN_UNMAXIMIZE);
|
||||
}
|
||||
|
||||
void
|
||||
mutter_plugin_map_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor)
|
||||
{
|
||||
mutter_plugin_window_effect_completed (plugin, actor, MUTTER_PLUGIN_MAP);
|
||||
}
|
||||
|
||||
void
|
||||
mutter_plugin_destroy_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor)
|
||||
{
|
||||
mutter_plugin_window_effect_completed (plugin, actor, MUTTER_PLUGIN_DESTROY);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -68,6 +68,7 @@ struct _MutterWindowPrivate
|
||||
guint redecorating : 1;
|
||||
|
||||
guint needs_damage_all : 1;
|
||||
guint received_damage : 1;
|
||||
|
||||
guint needs_pixmap : 1;
|
||||
guint needs_reshape : 1;
|
||||
@@ -337,7 +338,7 @@ mutter_window_constructed (GObject *object)
|
||||
priv->damage = None;
|
||||
else
|
||||
priv->damage = XDamageCreate (xdisplay, xwindow,
|
||||
XDamageReportRawRectangles);
|
||||
XDamageReportBoundingBox);
|
||||
|
||||
format = XRenderFindVisualFormat (xdisplay, priv->attrs.visual);
|
||||
|
||||
@@ -1652,6 +1653,8 @@ mutter_window_process_damage (MutterWindow *self,
|
||||
MutterWindowPrivate *priv = self->priv;
|
||||
ClutterX11TexturePixmap *texture_x11 = CLUTTER_X11_TEXTURE_PIXMAP (priv->actor);
|
||||
|
||||
priv->received_damage = TRUE;
|
||||
|
||||
if (is_frozen (self))
|
||||
{
|
||||
/* The window is frozen due to an effect in progress: we ignore damage
|
||||
@@ -1748,6 +1751,11 @@ mutter_window_update_shape (MutterWindow *self,
|
||||
void
|
||||
mutter_window_pre_paint (MutterWindow *self)
|
||||
{
|
||||
MutterWindowPrivate *priv = self->priv;
|
||||
MetaScreen *screen = priv->screen;
|
||||
MetaDisplay *display = meta_screen_get_display (screen);
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
|
||||
if (is_frozen (self))
|
||||
{
|
||||
/* The window is frozen due to a pending animation: we'll wait until
|
||||
@@ -1755,6 +1763,12 @@ mutter_window_pre_paint (MutterWindow *self)
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->received_damage)
|
||||
{
|
||||
XDamageSubtract (xdisplay, priv->damage, None, None);
|
||||
priv->received_damage = FALSE;
|
||||
}
|
||||
|
||||
check_needs_reshape (self);
|
||||
check_needs_pixmap (self);
|
||||
}
|
||||
|
@@ -81,11 +81,12 @@ static void unmaximize (MutterPlugin *plugin,
|
||||
gint x, gint y, gint width, gint height);
|
||||
|
||||
static void switch_workspace (MutterPlugin *plugin,
|
||||
const GList **actors, gint from, gint to,
|
||||
gint from, gint to,
|
||||
MetaMotionDirection direction);
|
||||
|
||||
static void kill_effect (MutterPlugin *plugin,
|
||||
MutterWindow *actor, gulong event);
|
||||
static void kill_window_effects (MutterPlugin *plugin,
|
||||
MutterWindow *actor);
|
||||
static void kill_switch_workspace (MutterPlugin *plugin);
|
||||
|
||||
static const MutterPluginInfo * plugin_info (MutterPlugin *plugin);
|
||||
|
||||
@@ -99,7 +100,6 @@ struct _MutterDefaultPluginPrivate
|
||||
/* Valid only when switch_workspace effect is in progress */
|
||||
ClutterTimeline *tml_switch_workspace1;
|
||||
ClutterTimeline *tml_switch_workspace2;
|
||||
GList **actors;
|
||||
ClutterActor *desktop1;
|
||||
ClutterActor *desktop2;
|
||||
|
||||
@@ -220,8 +220,9 @@ mutter_default_plugin_class_init (MutterDefaultPluginClass *klass)
|
||||
plugin_class->unmaximize = unmaximize;
|
||||
plugin_class->destroy = destroy;
|
||||
plugin_class->switch_workspace = switch_workspace;
|
||||
plugin_class->kill_effect = kill_effect;
|
||||
plugin_class->plugin_info = plugin_info;
|
||||
plugin_class->kill_window_effects = kill_window_effects;
|
||||
plugin_class->kill_switch_workspace = kill_switch_workspace;
|
||||
|
||||
g_type_class_add_private (gobject_class, sizeof (MutterDefaultPluginPrivate));
|
||||
}
|
||||
@@ -270,20 +271,12 @@ get_actor_private (MutterWindow *actor)
|
||||
return priv;
|
||||
}
|
||||
|
||||
typedef struct SwitchWorkspaceData
|
||||
{
|
||||
MutterPlugin *plugin;
|
||||
const GList **actors;
|
||||
} SwitchWorkspaceData;
|
||||
|
||||
static void
|
||||
on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
|
||||
{
|
||||
SwitchWorkspaceData *sw_data = data;
|
||||
MutterPlugin *plugin = sw_data->plugin;
|
||||
MutterPlugin *plugin = MUTTER_PLUGIN (data);
|
||||
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
||||
GList *l = *((GList**)sw_data->actors);
|
||||
MutterWindow *actor_for_cb = l->data;
|
||||
GList *l = mutter_plugin_get_windows (plugin);
|
||||
|
||||
while (l)
|
||||
{
|
||||
@@ -303,21 +296,17 @@ on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
|
||||
clutter_actor_destroy (priv->desktop1);
|
||||
clutter_actor_destroy (priv->desktop2);
|
||||
|
||||
priv->actors = NULL;
|
||||
priv->tml_switch_workspace1 = NULL;
|
||||
priv->tml_switch_workspace2 = NULL;
|
||||
priv->desktop1 = NULL;
|
||||
priv->desktop2 = NULL;
|
||||
|
||||
g_free (data);
|
||||
|
||||
mutter_plugin_effect_completed (plugin, actor_for_cb,
|
||||
MUTTER_PLUGIN_SWITCH_WORKSPACE);
|
||||
mutter_plugin_switch_workspace_completed (plugin);
|
||||
}
|
||||
|
||||
static void
|
||||
switch_workspace (MutterPlugin *plugin,
|
||||
const GList **actors, gint from, gint to,
|
||||
gint from, gint to,
|
||||
MetaMotionDirection direction)
|
||||
{
|
||||
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
||||
@@ -328,12 +317,8 @@ switch_workspace (MutterPlugin *plugin,
|
||||
ClutterActor *stage;
|
||||
int screen_width, screen_height;
|
||||
MetaScreen *screen = mutter_plugin_get_screen (plugin);
|
||||
SwitchWorkspaceData *sw_data = g_new (SwitchWorkspaceData, 1);
|
||||
ClutterAnimation *animation;
|
||||
|
||||
sw_data->plugin = plugin;
|
||||
sw_data->actors = actors;
|
||||
|
||||
stage = mutter_plugin_get_stage (plugin);
|
||||
|
||||
mutter_plugin_query_screen_size (plugin,
|
||||
@@ -353,14 +338,13 @@ switch_workspace (MutterPlugin *plugin,
|
||||
|
||||
if (from == to)
|
||||
{
|
||||
mutter_plugin_effect_completed (plugin, NULL,
|
||||
MUTTER_PLUGIN_SWITCH_WORKSPACE);
|
||||
mutter_plugin_switch_workspace_completed (plugin);
|
||||
return;
|
||||
}
|
||||
|
||||
n_workspaces = meta_screen_get_n_workspaces (screen);
|
||||
|
||||
l = g_list_last (*((GList**) actors));
|
||||
l = g_list_last (mutter_plugin_get_windows (plugin));
|
||||
|
||||
while (l)
|
||||
{
|
||||
@@ -395,7 +379,6 @@ switch_workspace (MutterPlugin *plugin,
|
||||
l = l->prev;
|
||||
}
|
||||
|
||||
priv->actors = (GList **)actors;
|
||||
priv->desktop1 = workspace0;
|
||||
priv->desktop2 = workspace1;
|
||||
|
||||
@@ -408,7 +391,7 @@ switch_workspace (MutterPlugin *plugin,
|
||||
g_signal_connect (priv->tml_switch_workspace1,
|
||||
"completed",
|
||||
G_CALLBACK (on_switch_workspace_effect_complete),
|
||||
sw_data);
|
||||
plugin);
|
||||
|
||||
animation = clutter_actor_animate (workspace1, CLUTTER_EASE_IN_SINE,
|
||||
SWITCH_TIMEOUT,
|
||||
@@ -446,8 +429,7 @@ on_minimize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data
|
||||
CLUTTER_GRAVITY_NORTH_WEST);
|
||||
|
||||
/* Now notify the manager that we are done with this effect */
|
||||
mutter_plugin_effect_completed (plugin, mc_window,
|
||||
MUTTER_PLUGIN_MINIMIZE);
|
||||
mutter_plugin_minimize_completed (plugin, mc_window);
|
||||
|
||||
g_free (data);
|
||||
}
|
||||
@@ -490,8 +472,7 @@ minimize (MutterPlugin *plugin, MutterWindow *mc_window)
|
||||
|
||||
}
|
||||
else
|
||||
mutter_plugin_effect_completed (plugin, mc_window,
|
||||
MUTTER_PLUGIN_MINIMIZE);
|
||||
mutter_plugin_minimize_completed (plugin, mc_window);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -516,8 +497,7 @@ on_maximize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data
|
||||
CLUTTER_GRAVITY_NORTH_WEST);
|
||||
|
||||
/* Now notify the manager that we are done with this effect */
|
||||
mutter_plugin_effect_completed (plugin, mc_window,
|
||||
MUTTER_PLUGIN_MAXIMIZE);
|
||||
mutter_plugin_maximize_completed (plugin, mc_window);
|
||||
|
||||
g_free (data);
|
||||
}
|
||||
@@ -587,8 +567,7 @@ maximize (MutterPlugin *plugin,
|
||||
return;
|
||||
}
|
||||
|
||||
mutter_plugin_effect_completed (plugin, mc_window,
|
||||
MUTTER_PLUGIN_MAXIMIZE);
|
||||
mutter_plugin_maximize_completed (plugin, mc_window);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -611,8 +590,7 @@ unmaximize (MutterPlugin *plugin,
|
||||
}
|
||||
|
||||
/* Do this conditionally, if the effect requires completion callback. */
|
||||
mutter_plugin_effect_completed (plugin, mc_window,
|
||||
MUTTER_PLUGIN_UNMAXIMIZE);
|
||||
mutter_plugin_unmaximize_completed (plugin, mc_window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -631,7 +609,7 @@ on_map_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
||||
CLUTTER_GRAVITY_NORTH_WEST);
|
||||
|
||||
/* Now notify the manager that we are done with this effect */
|
||||
mutter_plugin_effect_completed (plugin, mc_window, MUTTER_PLUGIN_MAP);
|
||||
mutter_plugin_map_completed (plugin, mc_window);
|
||||
|
||||
g_free (data);
|
||||
}
|
||||
@@ -677,8 +655,7 @@ map (MutterPlugin *plugin, MutterWindow *mc_window)
|
||||
|
||||
}
|
||||
else
|
||||
mutter_plugin_effect_completed (plugin, mc_window,
|
||||
MUTTER_PLUGIN_MAP);
|
||||
mutter_plugin_map_completed (plugin, mc_window);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -694,8 +671,7 @@ on_destroy_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
||||
|
||||
apriv->tml_destroy = NULL;
|
||||
|
||||
mutter_plugin_effect_completed (plugin, mc_window,
|
||||
MUTTER_PLUGIN_DESTROY);
|
||||
mutter_plugin_destroy_completed (plugin, mc_window);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -732,54 +708,48 @@ destroy (MutterPlugin *plugin, MutterWindow *mc_window)
|
||||
data);
|
||||
}
|
||||
else
|
||||
mutter_plugin_effect_completed (plugin, mc_window,
|
||||
MUTTER_PLUGIN_DESTROY);
|
||||
mutter_plugin_destroy_completed (plugin, mc_window);
|
||||
}
|
||||
|
||||
static void
|
||||
kill_effect (MutterPlugin *plugin, MutterWindow *mc_window, gulong event)
|
||||
kill_switch_workspace (MutterPlugin *plugin)
|
||||
{
|
||||
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
||||
|
||||
if (priv->tml_switch_workspace1)
|
||||
{
|
||||
clutter_timeline_stop (priv->tml_switch_workspace1);
|
||||
clutter_timeline_stop (priv->tml_switch_workspace2);
|
||||
g_signal_emit_by_name (priv->tml_switch_workspace1, "completed", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
kill_window_effects (MutterPlugin *plugin, MutterWindow *mc_window)
|
||||
{
|
||||
ActorPrivate *apriv;
|
||||
|
||||
if (event & MUTTER_PLUGIN_SWITCH_WORKSPACE)
|
||||
{
|
||||
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
||||
|
||||
if (priv->tml_switch_workspace1)
|
||||
{
|
||||
clutter_timeline_stop (priv->tml_switch_workspace1);
|
||||
clutter_timeline_stop (priv->tml_switch_workspace2);
|
||||
g_signal_emit_by_name (priv->tml_switch_workspace1, "completed", NULL);
|
||||
}
|
||||
|
||||
if (!(event & ~MUTTER_PLUGIN_SWITCH_WORKSPACE))
|
||||
{
|
||||
/* Workspace switch only, nothing more to do */
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
apriv = get_actor_private (mc_window);
|
||||
|
||||
if ((event & MUTTER_PLUGIN_MINIMIZE) && apriv->tml_minimize)
|
||||
if (apriv->tml_minimize)
|
||||
{
|
||||
clutter_timeline_stop (apriv->tml_minimize);
|
||||
g_signal_emit_by_name (apriv->tml_minimize, "completed", NULL);
|
||||
}
|
||||
|
||||
if ((event & MUTTER_PLUGIN_MAXIMIZE) && apriv->tml_maximize)
|
||||
if (apriv->tml_maximize)
|
||||
{
|
||||
clutter_timeline_stop (apriv->tml_maximize);
|
||||
g_signal_emit_by_name (apriv->tml_maximize, "completed", NULL);
|
||||
}
|
||||
|
||||
if ((event & MUTTER_PLUGIN_MAP) && apriv->tml_map)
|
||||
if (apriv->tml_map)
|
||||
{
|
||||
clutter_timeline_stop (apriv->tml_map);
|
||||
g_signal_emit_by_name (apriv->tml_map, "completed", NULL);
|
||||
}
|
||||
|
||||
if ((event & MUTTER_PLUGIN_DESTROY) && apriv->tml_destroy)
|
||||
if (apriv->tml_destroy)
|
||||
{
|
||||
clutter_timeline_stop (apriv->tml_destroy);
|
||||
g_signal_emit_by_name (apriv->tml_destroy, "completed", NULL);
|
||||
|
@@ -22,8 +22,7 @@
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#define _SVID_SOURCE /* for gethostname() */
|
||||
#define _XOPEN_SOURCE /* for kill() */
|
||||
|
||||
#include <config.h>
|
||||
#include "util.h"
|
||||
@@ -179,36 +178,23 @@ meta_window_delete (MetaWindow *window,
|
||||
void
|
||||
meta_window_kill (MetaWindow *window)
|
||||
{
|
||||
char buf[257];
|
||||
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Killing %s brutally\n",
|
||||
window->desc);
|
||||
|
||||
if (window->wm_client_machine != NULL &&
|
||||
if (!meta_window_is_remote (window) &&
|
||||
window->net_wm_pid > 0)
|
||||
{
|
||||
if (gethostname (buf, sizeof(buf)-1) == 0)
|
||||
{
|
||||
if (strcmp (buf, window->wm_client_machine) == 0)
|
||||
{
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Killing %s with kill()\n",
|
||||
window->desc);
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Killing %s with kill()\n",
|
||||
window->desc);
|
||||
|
||||
if (kill (window->net_wm_pid, 9) < 0)
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Failed to signal %s: %s\n",
|
||||
window->desc, strerror (errno));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_warning (_("Failed to get hostname: %s\n"),
|
||||
strerror (errno));
|
||||
}
|
||||
if (kill (window->net_wm_pid, 9) < 0)
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Failed to signal %s: %s\n",
|
||||
window->desc, strerror (errno));
|
||||
}
|
||||
|
||||
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Disconnecting %s with XKillClient()\n",
|
||||
window->desc);
|
||||
|
@@ -83,10 +83,11 @@ struct _MetaDisplay
|
||||
|
||||
char *name;
|
||||
Display *xdisplay;
|
||||
char *hostname;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
@@ -30,6 +30,8 @@
|
||||
* The display is represented as a MetaDisplay struct.
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 600 /* for gethostname() */
|
||||
|
||||
#include <config.h>
|
||||
#include "display-private.h"
|
||||
#include "util.h"
|
||||
@@ -72,6 +74,7 @@
|
||||
#include <X11/extensions/Xdamage.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define GRAB_OP_IS_WINDOW_SWITCH(g) \
|
||||
(g == META_GRAB_OP_KEYBOARD_TABBING_NORMAL || \
|
||||
@@ -429,6 +432,7 @@ meta_display_open (void)
|
||||
GSList *tmp;
|
||||
int i;
|
||||
guint32 timestamp;
|
||||
char buf[257];
|
||||
|
||||
/* A list of all atom names, so that we can intern them in one go. */
|
||||
char *atom_names[] = {
|
||||
@@ -463,6 +467,11 @@ meta_display_open (void)
|
||||
*/
|
||||
the_display->name = g_strdup (XDisplayName (NULL));
|
||||
the_display->xdisplay = xdisplay;
|
||||
if (gethostname (buf, sizeof(buf)-1) == 0)
|
||||
{
|
||||
buf[sizeof(buf)-1] = '\0';
|
||||
the_display->hostname = g_strdup (buf);
|
||||
}
|
||||
the_display->error_trap_synced_at_last_pop = TRUE;
|
||||
the_display->error_traps = 0;
|
||||
the_display->error_trap_handler = NULL;
|
||||
|
104
src/core/util.c
104
src/core/util.c
@@ -40,6 +40,12 @@
|
||||
#include <X11/Xlib.h> /* must explicitly be included for Solaris; #326746 */
|
||||
#include <X11/Xutil.h> /* Just for the definition of the various gravities */
|
||||
|
||||
static void
|
||||
meta_topic_real_valist (MetaDebugTopic topic,
|
||||
const char *format,
|
||||
va_list args);
|
||||
|
||||
|
||||
#ifdef HAVE_BACKTRACE
|
||||
#include <execinfo.h>
|
||||
void
|
||||
@@ -71,7 +77,7 @@ meta_print_backtrace (void)
|
||||
}
|
||||
#endif
|
||||
|
||||
static gboolean is_verbose = FALSE;
|
||||
static gint verbose_topics = 0;
|
||||
static gboolean is_debugging = FALSE;
|
||||
static gboolean replace_current = FALSE;
|
||||
static int no_prefix = 0;
|
||||
@@ -128,7 +134,7 @@ ensure_logfile (void)
|
||||
gboolean
|
||||
meta_is_verbose (void)
|
||||
{
|
||||
return is_verbose;
|
||||
return verbose_topics != 0;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -141,8 +147,48 @@ meta_set_verbose (gboolean setting)
|
||||
if (setting)
|
||||
ensure_logfile ();
|
||||
#endif
|
||||
|
||||
is_verbose = setting;
|
||||
|
||||
if (setting)
|
||||
meta_add_verbose_topic (META_DEBUG_VERBOSE);
|
||||
else
|
||||
meta_remove_verbose_topic (META_DEBUG_VERBOSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_add_verbose_topic:
|
||||
* @topic: Topic for which logging will be started
|
||||
*
|
||||
* Ensure log messages for the given topic @topic
|
||||
* will be printed.
|
||||
*/
|
||||
void
|
||||
meta_add_verbose_topic (MetaDebugTopic topic)
|
||||
{
|
||||
if (verbose_topics == META_DEBUG_VERBOSE)
|
||||
return;
|
||||
if (topic == META_DEBUG_VERBOSE)
|
||||
verbose_topics = META_DEBUG_VERBOSE;
|
||||
else
|
||||
verbose_topics |= topic;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_remove_verbose_topic:
|
||||
* @topic: Topic for which logging will be stopped
|
||||
*
|
||||
* Stop printing log messages for the given topic @topic. Note
|
||||
* that this method does not stack with meta_add_verbose_topic();
|
||||
* i.e. if two calls to meta_add_verbose_topic() for the same
|
||||
* topic are made, one call to meta_remove_verbose_topic() will
|
||||
* remove it.
|
||||
*/
|
||||
void
|
||||
meta_remove_verbose_topic (MetaDebugTopic topic)
|
||||
{
|
||||
if (topic == META_DEBUG_VERBOSE)
|
||||
verbose_topics = 0;
|
||||
else
|
||||
verbose_topics &= ~topic;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -250,27 +296,10 @@ void
|
||||
meta_verbose_real (const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
gchar *str;
|
||||
FILE *out;
|
||||
|
||||
g_return_if_fail (format != NULL);
|
||||
|
||||
if (!is_verbose)
|
||||
return;
|
||||
|
||||
va_start (args, format);
|
||||
str = g_strdup_vprintf (format, args);
|
||||
meta_topic_real_valist (META_DEBUG_VERBOSE, format, args);
|
||||
va_end (args);
|
||||
|
||||
out = logfile ? logfile : stderr;
|
||||
|
||||
if (no_prefix == 0)
|
||||
utf8_fputs ("Window manager: ", out);
|
||||
utf8_fputs (str, out);
|
||||
|
||||
fflush (out);
|
||||
|
||||
g_free (str);
|
||||
}
|
||||
#endif /* WITH_VERBOSE_MODE */
|
||||
|
||||
@@ -324,6 +353,8 @@ topic_name (MetaDebugTopic topic)
|
||||
return "COMPOSITOR";
|
||||
case META_DEBUG_EDGE_RESISTANCE:
|
||||
return "EDGE_RESISTANCE";
|
||||
case META_DEBUG_VERBOSE:
|
||||
return "VERBOSE";
|
||||
}
|
||||
|
||||
return "WM";
|
||||
@@ -331,23 +362,22 @@ topic_name (MetaDebugTopic topic)
|
||||
|
||||
static int sync_count = 0;
|
||||
|
||||
void
|
||||
meta_topic_real (MetaDebugTopic topic,
|
||||
const char *format,
|
||||
...)
|
||||
static void
|
||||
meta_topic_real_valist (MetaDebugTopic topic,
|
||||
const char *format,
|
||||
va_list args)
|
||||
{
|
||||
va_list args;
|
||||
gchar *str;
|
||||
FILE *out;
|
||||
|
||||
g_return_if_fail (format != NULL);
|
||||
|
||||
if (!is_verbose)
|
||||
if (verbose_topics == 0
|
||||
|| (topic == META_DEBUG_VERBOSE && verbose_topics != META_DEBUG_VERBOSE)
|
||||
|| (!(verbose_topics & topic)))
|
||||
return;
|
||||
|
||||
va_start (args, format);
|
||||
|
||||
str = g_strdup_vprintf (format, args);
|
||||
va_end (args);
|
||||
|
||||
out = logfile ? logfile : stderr;
|
||||
|
||||
@@ -366,6 +396,18 @@ meta_topic_real (MetaDebugTopic topic,
|
||||
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
void
|
||||
meta_topic_real (MetaDebugTopic topic,
|
||||
const char *format,
|
||||
...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start (args, format);
|
||||
meta_topic_real_valist (topic, format, args);
|
||||
va_end (args);
|
||||
}
|
||||
#endif /* WITH_VERBOSE_MODE */
|
||||
|
||||
void
|
||||
|
@@ -3235,10 +3235,6 @@ meta_window_unmaximize (MetaWindow *window,
|
||||
window->display->grab_anchor_window_pos = target_rect;
|
||||
}
|
||||
|
||||
/* Make sure user_rect is current.
|
||||
*/
|
||||
force_save_user_window_placement (window);
|
||||
|
||||
if (window->display->compositor)
|
||||
{
|
||||
MetaRectangle old_rect, new_rect;
|
||||
@@ -3268,6 +3264,10 @@ meta_window_unmaximize (MetaWindow *window,
|
||||
target_rect.height);
|
||||
}
|
||||
|
||||
/* Make sure user_rect is current.
|
||||
*/
|
||||
force_save_user_window_placement (window);
|
||||
|
||||
recalc_window_features (window);
|
||||
set_net_wm_state (window);
|
||||
}
|
||||
@@ -9115,6 +9115,21 @@ meta_window_get_client_machine (MetaWindow *window)
|
||||
return window->wm_client_machine;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_window_is_remote:
|
||||
* @window: a #MetaWindow
|
||||
*
|
||||
* Returns: %TRUE if this window originates from a host
|
||||
* different from the one running mutter.
|
||||
*/
|
||||
gboolean
|
||||
meta_window_is_remote (MetaWindow *window)
|
||||
{
|
||||
g_return_val_if_fail (META_IS_WINDOW (window), FALSE);
|
||||
|
||||
return g_strcmp0 (window->wm_client_machine, window->display->hostname) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_window_is_modal:
|
||||
* @window: a #MetaWindow
|
||||
|
@@ -32,19 +32,6 @@
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
/*
|
||||
* FIXME -- move these to a private include
|
||||
* Required by plugin manager.
|
||||
*/
|
||||
#define MUTTER_PLUGIN_MINIMIZE (1<<0)
|
||||
#define MUTTER_PLUGIN_MAXIMIZE (1<<1)
|
||||
#define MUTTER_PLUGIN_UNMAXIMIZE (1<<2)
|
||||
#define MUTTER_PLUGIN_MAP (1<<3)
|
||||
#define MUTTER_PLUGIN_DESTROY (1<<4)
|
||||
#define MUTTER_PLUGIN_SWITCH_WORKSPACE (1<<5)
|
||||
|
||||
#define MUTTER_PLUGIN_ALL_EFFECTS (~0)
|
||||
|
||||
#define MUTTER_TYPE_PLUGIN (mutter_plugin_get_type ())
|
||||
#define MUTTER_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUTTER_TYPE_PLUGIN, MutterPlugin))
|
||||
#define MUTTER_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUTTER_TYPE_PLUGIN, MutterPluginClass))
|
||||
@@ -95,20 +82,18 @@ struct _MutterPluginClass
|
||||
MutterWindow *actor);
|
||||
|
||||
void (*switch_workspace) (MutterPlugin *plugin,
|
||||
const GList **actors,
|
||||
gint from,
|
||||
gint to,
|
||||
MetaMotionDirection direction);
|
||||
|
||||
/*
|
||||
* Called if an effect should be killed prematurely; the plugin must
|
||||
* Called if an effects should be killed prematurely; the plugin must
|
||||
* call the completed() callback as if the effect terminated naturally.
|
||||
* The events parameter is a bitmask indicating which effects are to be
|
||||
* killed.
|
||||
*/
|
||||
void (*kill_effect) (MutterPlugin *plugin,
|
||||
MutterWindow *actor,
|
||||
gulong events);
|
||||
void (*kill_window_effects) (MutterPlugin *plugin,
|
||||
MutterWindow *actor);
|
||||
|
||||
void (*kill_switch_workspace) (MutterPlugin *plugin);
|
||||
|
||||
/* General XEvent filter. This is fired *before* mutter itself handles
|
||||
* an event. Return TRUE to block any further processing.
|
||||
@@ -227,9 +212,27 @@ struct _MutterPluginVersion
|
||||
} \
|
||||
|
||||
void
|
||||
mutter_plugin_effect_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor,
|
||||
unsigned long event);
|
||||
mutter_plugin_switch_workspace_completed (MutterPlugin *plugin);
|
||||
|
||||
void
|
||||
mutter_plugin_minimize_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor);
|
||||
|
||||
void
|
||||
mutter_plugin_maximize_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor);
|
||||
|
||||
void
|
||||
mutter_plugin_unmaximize_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor);
|
||||
|
||||
void
|
||||
mutter_plugin_map_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor);
|
||||
|
||||
void
|
||||
mutter_plugin_destroy_completed (MutterPlugin *plugin,
|
||||
MutterWindow *actor);
|
||||
|
||||
ClutterActor *
|
||||
mutter_plugin_get_overlay_group (MutterPlugin *plugin);
|
||||
|
@@ -51,6 +51,7 @@ void meta_fatal (const char *format,
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_DEBUG_VERBOSE = -1,
|
||||
META_DEBUG_FOCUS = 1 << 0,
|
||||
META_DEBUG_WORKAREA = 1 << 1,
|
||||
META_DEBUG_STACK = 1 << 2,
|
||||
@@ -78,6 +79,8 @@ typedef enum
|
||||
void meta_topic_real (MetaDebugTopic topic,
|
||||
const char *format,
|
||||
...) G_GNUC_PRINTF (2, 3);
|
||||
void meta_add_verbose_topic (MetaDebugTopic topic);
|
||||
void meta_remove_verbose_topic (MetaDebugTopic topic);
|
||||
|
||||
void meta_push_no_msg_prefix (void);
|
||||
void meta_pop_no_msg_prefix (void);
|
||||
|
@@ -140,6 +140,7 @@ guint meta_window_get_stable_sequence (MetaWindow *window);
|
||||
guint32 meta_window_get_user_time (MetaWindow *window);
|
||||
int meta_window_get_pid (MetaWindow *window);
|
||||
const char *meta_window_get_client_machine (MetaWindow *window);
|
||||
gboolean meta_window_is_remote (MetaWindow *window);
|
||||
gboolean meta_window_is_modal (MetaWindow *window);
|
||||
const char *meta_window_get_mutter_hints (MetaWindow *window);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user