summaryrefslogtreecommitdiffstats
path: root/gfx/gtk_preserve_window.h
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-28 19:22:44 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-28 19:22:44 +0000
commita89a7314517eda116348ae314289cde228fc637b (patch)
treea0247c61a7236df87b7f14ee48160dcf8e4cec2b /gfx/gtk_preserve_window.h
parent34c190328b287081617fc0f36592ac4a45c2a213 (diff)
downloadchromium_src-a89a7314517eda116348ae314289cde228fc637b.zip
chromium_src-a89a7314517eda116348ae314289cde228fc637b.tar.gz
chromium_src-a89a7314517eda116348ae314289cde228fc637b.tar.bz2
Alternative to overlays on X windows.
Created a new GTK widget that gives us more control over when X windows (associated with GL contexts) are created and destroyed. This achieves the same thing as the overlay code (now reverted). It fixes two regressions with the overlay code: - maps.google.com and html5test.com now work (switching between software and hardware rendering) - expose events now get through in accelerated mode BUG=58862,59887 TEST=Go to html5test.com. Should switch contents to show results. Disable compositing window manager. Go to http://peter.sh/2010/06/chromium-now-features-gpu-acceleration-and-css-3d-transforms/. Adjust the rotate z slider to enable accelerated compositing. Drag a different window over top. Redraws should happen. Review URL: http://codereview.chromium.org/3973009 Patch from Jonathan Backer <backer@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64291 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx/gtk_preserve_window.h')
-rw-r--r--gfx/gtk_preserve_window.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/gfx/gtk_preserve_window.h b/gfx/gtk_preserve_window.h
new file mode 100644
index 0000000..285d82c
--- /dev/null
+++ b/gfx/gtk_preserve_window.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GFX_GTK_PRESERVE_WINDOW_H_
+#define GFX_GTK_PRESERVE_WINDOW_H_
+#pragma once
+
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+
+// GtkFixed creates an X window when realized and destroys an X window
+// when unrealized. GtkPreserveWindow allows overrides this
+// behaviour. When preserve is set (via gtk_preserve_window_set_preserve),
+// the X window is only destroyed when the widget is destroyed.
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_PRESERVE_WINDOW \
+ (gtk_preserve_window_get_type())
+#define GTK_PRESERVE_WINDOW(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_PERSERVE_WINDOW, \
+ GtkPreserveWindow))
+#define GTK_PRESERVE_WINDOW_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_PRESERVE_WINDOW, \
+ GtkPreserveWindowClass))
+#define GTK_IS_PRESERVE_WINDOW(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_PRESERVE_WINDOW))
+#define GTK_IS_PRESERVE_WINDOW_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_PRESERVE_WINDOW))
+#define GTK_PRESERVE_WINDOW_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_PRESERVE_WINDOW, \
+ GtkPreserveWindowClass))
+
+typedef struct _GtkPreserveWindow GtkPreserveWindow;
+typedef struct _GtkPreserveWindowClass GtkPreserveWindowClass;
+
+struct _GtkPreserveWindow {
+ // Parent class.
+ GtkFixed fixed;
+};
+
+struct _GtkPreserveWindowClass {
+ GtkFixedClass parent_class;
+};
+
+GType gtk_preserve_window_get_type() G_GNUC_CONST;
+GtkWidget* gtk_preserve_window_new();
+
+// Whether or not we should preserve associated windows as the widget
+// is realized or unrealized.
+gboolean gtk_preserve_window_get_preserve(GtkPreserveWindow* widget);
+void gtk_preserve_window_set_preserve(GtkPreserveWindow* widget,
+ gboolean value);
+
+G_END_DECLS
+
+#endif // GFX_GTK_PRESERVE_WINDOW_H_