]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdkoffscreenwindow.c
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gdk / gdkoffscreenwindow.c
index fa1518f0d7674a8150ca72b627513b3032ca31ff..aed09e0e83097d92756c9a580811a2ae8d408421 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -87,15 +85,11 @@ gdk_offscreen_window_init (GdkOffscreenWindow *window)
 
 static void
 gdk_offscreen_window_destroy (GdkWindow *window,
-                             gboolean   recursing,
-                             gboolean   foreign_destroy)
+                              gboolean   recursing,
+                              gboolean   foreign_destroy)
 {
-  GdkOffscreenWindow *offscreen;
-
-  offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
-
   gdk_offscreen_window_set_embedder (window, NULL);
-  
+
   if (!recursing)
     gdk_offscreen_window_hide (window);
 }
@@ -149,19 +143,12 @@ _gdk_offscreen_window_create_surface (GdkWindow *offscreen,
 {
   cairo_surface_t *similar;
   cairo_surface_t *surface;
-  cairo_content_t  content = CAIRO_CONTENT_COLOR;
 
   g_return_val_if_fail (GDK_IS_OFFSCREEN_WINDOW (offscreen->impl), NULL);
 
   similar = _gdk_window_ref_cairo_surface (offscreen->parent);
 
-  if (gdk_window_get_visual (offscreen) ==
-      gdk_screen_get_rgba_visual (gdk_window_get_screen (offscreen)))
-    {
-      content = CAIRO_CONTENT_COLOR_ALPHA;
-    }
-
-  surface = cairo_surface_create_similar (similar, content, width, height);
+  surface = cairo_surface_create_similar (similar, CAIRO_CONTENT_COLOR_ALPHA, width, height);
 
   cairo_surface_destroy (similar);
 
@@ -230,6 +217,13 @@ gdk_offscreen_window_reparent (GdkWindow *window,
   return was_mapped;
 }
 
+static void
+gdk_offscreen_window_set_device_cursor (GdkWindow     *window,
+                                       GdkDevice     *device,
+                                       GdkCursor     *cursor)
+{
+}
+
 static void
 from_embedder (GdkWindow *window,
               double embedder_x, double embedder_y,
@@ -334,7 +328,7 @@ gdk_offscreen_window_get_device_state (GdkWindow       *window,
  * If you need to keep this around over window resizes, you need to
  * add a reference to it.
  *
- * Returns: The offscreen surface, or %NULL if not offscreen
+ * Returns: (transfer none): The offscreen surface, or %NULL if not offscreen
  */
 cairo_surface_t *
 gdk_offscreen_window_get_surface (GdkWindow *window)
@@ -367,14 +361,13 @@ gdk_offscreen_window_lower (GdkWindow *window)
 
 static void
 gdk_offscreen_window_move_resize_internal (GdkWindow *window,
-                                          gint       x,
-                                          gint       y,
-                                          gint       width,
-                                          gint       height,
-                                          gboolean   send_expose_events)
+                                           gint       x,
+                                           gint       y,
+                                           gint       width,
+                                           gint       height,
+                                           gboolean   send_expose_events)
 {
   GdkOffscreenWindow *offscreen;
-  gint dx, dy, dw, dh;
 
   offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
 
@@ -386,11 +379,6 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
   if (window->destroyed)
     return;
 
-  dx = x - window->x;
-  dy = y - window->y;
-  dw = width - window->width;
-  dh = height - window->height;
-
   window->x = x;
   window->y = y;
 
@@ -421,7 +409,7 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
 
   if (GDK_WINDOW_IS_MAPPED (window))
     {
-      // TODO: Only invalidate new area, i.e. for larger windows
+      /* TODO: Only invalidate new area, i.e. for larger windows */
       gdk_window_invalidate_rect (window, NULL, TRUE);
       _gdk_synthesize_crossing_events_for_geometry_change (window);
     }
@@ -429,16 +417,12 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
 
 static void
 gdk_offscreen_window_move_resize (GdkWindow *window,
-                                 gboolean   with_move,
-                                 gint       x,
-                                 gint       y,
-                                 gint       width,
-                                 gint       height)
+                                  gboolean   with_move,
+                                  gint       x,
+                                  gint       y,
+                                  gint       width,
+                                  gint       height)
 {
-  GdkOffscreenWindow *offscreen;
-
-  offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
-
   if (!with_move)
     {
       x = window->x;
@@ -451,9 +435,9 @@ gdk_offscreen_window_move_resize (GdkWindow *window,
   if (height < 0)
     height = window->height;
 
-  gdk_offscreen_window_move_resize_internal (window, x, y,
-                                            width, height,
-                                            TRUE);
+  gdk_offscreen_window_move_resize_internal (window,
+                                             x, y, width, height,
+                                             TRUE);
 }
 
 static void
@@ -469,6 +453,8 @@ gdk_offscreen_window_show (GdkWindow *window,
 static void
 gdk_offscreen_window_hide (GdkWindow *window)
 {
+  /* TODO: This needs updating to the new grab world */
+#if 0
   GdkOffscreenWindow *offscreen;
   GdkDisplay *display;
 
@@ -479,8 +465,6 @@ gdk_offscreen_window_hide (GdkWindow *window)
   /* May need to break grabs on children */
   display = gdk_window_get_display (window);
 
-  /* TODO: This needs updating to the new grab world */
-#if 0
   if (display->pointer_grab.window != NULL)
     {
       if (is_parent_of (window, display->pointer_grab.window))
@@ -698,6 +682,30 @@ gdk_offscreen_window_set_boolean (GdkWindow *window,
 {
 }
 
+static void
+gdk_offscreen_window_set_string (GdkWindow *window,
+                                const gchar *setting)
+{
+}
+
+static void
+gdk_offscreen_window_set_list (GdkWindow *window,
+                               GList *list)
+{
+}
+
+static void
+gdk_offscreen_window_set_wmfunctions (GdkWindow            *window,
+                                     GdkWMFunction  functions)
+{
+}
+
+static void
+gdk_offscreen_window_set_transient_for (GdkWindow *window,
+                                       GdkWindow *another)
+{
+}
+
 static void
 gdk_offscreen_window_process_updates_recurse (GdkWindow *window,
                                               cairo_region_t *region)
@@ -726,7 +734,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   impl_class->move_resize = gdk_offscreen_window_move_resize;
   impl_class->set_background = gdk_offscreen_window_set_background;
   impl_class->reparent = gdk_offscreen_window_reparent;
-  impl_class->set_device_cursor = NULL;
+  impl_class->set_device_cursor = gdk_offscreen_window_set_device_cursor;
   impl_class->get_geometry = gdk_offscreen_window_get_geometry;
   impl_class->get_root_coords = gdk_offscreen_window_get_root_coords;
   impl_class->get_device_state = gdk_offscreen_window_get_device_state;
@@ -748,19 +756,19 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   impl_class->set_modal_hint = NULL;
   impl_class->set_skip_taskbar_hint = gdk_offscreen_window_set_boolean;
   impl_class->set_skip_pager_hint = gdk_offscreen_window_set_boolean;
-  impl_class->set_urgency_hint = NULL;
+  impl_class->set_urgency_hint = gdk_offscreen_window_set_boolean;
   impl_class->set_geometry_hints = NULL;
-  impl_class->set_title = NULL;
-  impl_class->set_role = NULL;
-  impl_class->set_startup_id = NULL;
-  impl_class->set_transient_for = NULL;
+  impl_class->set_title = gdk_offscreen_window_set_string;
+  impl_class->set_role = gdk_offscreen_window_set_string;
+  impl_class->set_startup_id = gdk_offscreen_window_set_string;
+  impl_class->set_transient_for = gdk_offscreen_window_set_transient_for;
   impl_class->get_root_origin = NULL;
   impl_class->get_frame_extents = NULL;
   impl_class->set_override_redirect = NULL;
   impl_class->set_accept_focus = NULL;
-  impl_class->set_focus_on_map = NULL;
-  impl_class->set_icon_list = NULL;
-  impl_class->set_icon_name = NULL;
+  impl_class->set_focus_on_map = gdk_offscreen_window_set_boolean;
+  impl_class->set_icon_list = gdk_offscreen_window_set_list;
+  impl_class->set_icon_name = gdk_offscreen_window_set_string;
   impl_class->iconify = gdk_offscreen_window_do_nothing;
   impl_class->deiconify = gdk_offscreen_window_do_nothing;
   impl_class->stick = gdk_offscreen_window_do_nothing;
@@ -775,8 +783,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   impl_class->set_group = NULL;
   impl_class->set_decorations = NULL;
   impl_class->get_decorations = NULL;
-  impl_class->set_functions = NULL;
-  impl_class->set_functions = NULL;
+  impl_class->set_functions = gdk_offscreen_window_set_wmfunctions;
   impl_class->begin_resize_drag = NULL;
   impl_class->begin_move_drag = NULL;
   impl_class->enable_synchronized_configure = gdk_offscreen_window_do_nothing;
@@ -784,7 +791,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   impl_class->set_opacity = NULL;
   impl_class->set_composited = NULL;
   impl_class->destroy_notify = NULL;
-  impl_class->register_dnd = NULL;
+  impl_class->register_dnd = gdk_offscreen_window_do_nothing;
   impl_class->drag_begin = NULL;
   impl_class->process_updates_recurse = gdk_offscreen_window_process_updates_recurse;
   impl_class->sync_rendering = NULL;