~darkxst/ubuntu/saucy/gnome-shell/upstart_log

« back to all changes in this revision

Viewing changes to src/shell-embedded-window.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-05-31 12:01:12 UTC
  • mfrom: (1.1.49) (19.1.36 experimental)
  • Revision ID: package-import@ubuntu.com-20130531120112-ew91khxf051x9i2r
Tags: 3.8.2-1ubuntu1
* Merge with Debian (LP: #1185869, #1185721). Remaining changes:
  - debian/control.in:
    + Build-depend on libsystemd-login-dev & libsystemd-daemon-dev
    + Depend on gdm instead of gdm3
    + Don't recommend gnome-session-fallback
  - debian/patches/40_change-pam-name-to-match-gdm.patch:
  - debian/patches/revert-suspend-break.patch:
    + Disabled, not needed on Ubuntu
  - debian/patches/ubuntu-lightdm-user-switching.patch:
    + Allow user switching when using LightDM. Thanks Gerhard Stein
      for rebasing against gnome-shell 3.8!
  - debian/patches/ubuntu_lock_on_suspend.patch
    + Respect Ubuntu's lock-on-suspend setting.
      Disabled until it can be rewritten.
  - debian/patches/git_relock_screen_after_crash.patch:
    + Add Upstream fix for unlocked session after crash (LP: #1064584)
* Note that the new GNOME Classic mode (which requires installing
  gnome-shell-extensions) won't work until gnome-session 3.8 is
  available in Ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#include "shell-embedded-window-private.h"
9
9
 
10
10
/* This type is a subclass of GtkWindow that ties the window to a
11
 
 * ShellGtkEmbed; the window is reparented into the stage
12
 
 * window for the actor and the resizing logic is bound to the clutter
13
 
 * logic.
 
11
 * ShellGtkEmbed; the resizing logic is bound to the clutter logic.
14
12
 *
15
13
 * The typical usage we might expect is
16
14
 *
28
26
G_DEFINE_TYPE (ShellEmbeddedWindow, shell_embedded_window, GTK_TYPE_WINDOW);
29
27
 
30
28
enum {
31
 
   PROP_0,
32
 
 
33
 
   PROP_STAGE
 
29
   PROP_0
34
30
};
35
31
 
36
32
struct _ShellEmbeddedWindowPrivate {
37
33
  ShellGtkEmbed *actor;
38
34
 
39
35
  GdkRectangle position;
40
 
  Window stage_xwindow;
41
36
};
42
37
 
43
38
/*
80
75
  GTK_WIDGET_CLASS (shell_embedded_window_parent_class)->hide (widget);
81
76
}
82
77
 
83
 
static void
84
 
shell_embedded_window_realize (GtkWidget *widget)
85
 
{
86
 
  ShellEmbeddedWindow *window = SHELL_EMBEDDED_WINDOW (widget);
87
 
 
88
 
  GTK_WIDGET_CLASS (shell_embedded_window_parent_class)->realize (widget);
89
 
 
90
 
 
91
 
  /* Using XReparentWindow() is simpler than using gdk_window_reparent(),
92
 
   * since it avoids maybe having to create a new foreign GDK window for
93
 
   * the stage. However, GDK will be left thinking that the parent of
94
 
   * window->window is the root window - it's not immediately clear
95
 
   * to me whether that is more or less likely to cause problems than
96
 
   * modifying the GDK hierarchy.
97
 
   */
98
 
  XReparentWindow (GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget)),
99
 
                   gdk_x11_window_get_xid (gtk_widget_get_window (widget)),
100
 
                   window->priv->stage_xwindow,
101
 
                   window->priv->position.x, window->priv->position.y);
102
 
}
103
 
 
104
78
static gboolean
105
79
shell_embedded_window_configure_event (GtkWidget         *widget,
106
80
                                       GdkEventConfigure *event)
127
101
    clutter_actor_queue_relayout (CLUTTER_ACTOR (window->priv->actor));
128
102
}
129
103
 
130
 
static void
131
 
shell_embedded_window_set_property (GObject         *object,
132
 
                                    guint            prop_id,
133
 
                                    const GValue    *value,
134
 
                                    GParamSpec      *pspec)
135
 
{
136
 
  ShellEmbeddedWindow *window = SHELL_EMBEDDED_WINDOW (object);
137
 
 
138
 
  switch (prop_id)
139
 
    {
140
 
    case PROP_STAGE:
141
 
      window->priv->stage_xwindow =
142
 
        clutter_x11_get_stage_window (g_value_get_object (value));
143
 
      break;
144
 
 
145
 
    default:
146
 
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
147
 
      break;
148
 
    }
149
 
}
150
 
 
151
104
static GObject *
152
105
shell_embedded_window_constructor (GType                  gtype,
153
106
                                   guint                  n_properties,
182
135
 
183
136
  g_type_class_add_private (klass, sizeof (ShellEmbeddedWindowPrivate));
184
137
 
185
 
  object_class->set_property    = shell_embedded_window_set_property;
186
138
  object_class->constructor     = shell_embedded_window_constructor;
187
139
 
188
140
  widget_class->show            = shell_embedded_window_show;
189
141
  widget_class->hide            = shell_embedded_window_hide;
190
 
  widget_class->realize         = shell_embedded_window_realize;
191
142
  widget_class->configure_event = shell_embedded_window_configure_event;
192
143
 
193
144
  container_class->check_resize    = shell_embedded_window_check_resize;
194
 
 
195
 
  g_object_class_install_property (object_class,
196
 
                                   PROP_STAGE,
197
 
                                   g_param_spec_object ("stage",
198
 
                                                        "Stage",
199
 
                                                        "ClutterStage to embed on",
200
 
                                                        CLUTTER_TYPE_STAGE,
201
 
                                                        G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
202
145
}
203
146
 
204
147
static void
282
225
 * Public API
283
226
 */
284
227
GtkWidget *
285
 
shell_embedded_window_new (ClutterStage *stage)
 
228
shell_embedded_window_new (void)
286
229
{
287
230
  return g_object_new (SHELL_TYPE_EMBEDDED_WINDOW,
288
 
                       "stage", stage,
289
231
                       NULL);
290
232
}