Skip to content

Commit

Permalink
#1443: implement config.get_depth in gtkglext and expose it in pygtkg…
Browse files Browse the repository at this point in the history
…lext

git-svn-id: https://xpra.org/svn/Xpra/trunk@15375 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 24, 2017
1 parent 5e02d54 commit ce4a2aa
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
28 changes: 28 additions & 0 deletions osx/jhbuild/patches/gtkglext-depth.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--- a/gdk/quartz/gdkglconfig-quartz.m 2017-03-24 14:11:48.000000000 +0700
+++ b/gdk/quartz/gdkglconfig-quartz.m 2017-03-24 14:16:42.000000000 +0700
@@ -12,6 +12,25 @@

static gpointer parent_class = NULL;

+/**
+ * Gets the color depth of the OpenGL-capable visual.
+ *
+ * Return value: number of bits per pixel
+ **/
+gint
+gdk_gl_config_get_depth (GdkGLConfig *glconfig)
+{
+ g_return_val_if_fail (GDK_IS_GL_CONFIG_IMPL_QUARTZ (glconfig), 0);
+ GdkGLConfigImplQuartz *glQuartzConfig = GDK_GL_CONFIG_IMPL_QUARTZ(glconfig);
+ NSArray *array = [NSScreen screens];
+ int i = glQuartzConfig->screen_num;
+ if (array.count<=i) {
+ return 24;
+ }
+ NSScreen *nsscreen = [array objectAtIndex:i];
+ return NSBitsPerPixelFromDepth(nsscreen.depth);
+}
+

GType
gdk_gl_config_impl_quartz_get_type (void)
6 changes: 0 additions & 6 deletions osx/jhbuild/patches/pygtkglext-osx-v4.patch
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,6 @@ index f3f8e69..37fb930 100644
(return-type "GdkVisual*")
)

-(define-method get_depth
- (of-object "GdkGLConfig")
- (c-name "gdk_gl_config_get_depth")
- (return-type "gint")
-)
-
(define-method get_layer_plane
(of-object "GdkGLConfig")
(c-name "gdk_gl_config_get_layer_plane")
Expand Down
1 change: 1 addition & 0 deletions osx/jhbuild/xpra.modules
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
checkoutdir="gtkglext-1.2.0"
repo="xpra.org">
<patch file="http://xpra.org/svn/Xpra/trunk/osx/jhbuild/patches/xpra-gtkglext.patch" strip="1"/>
<patch file="http://xpra.org/svn/Xpra/trunk/osx/jhbuild/patches/gtkglext-depth.patch" strip="1"/>
</branch>
</autotools>

Expand Down

0 comments on commit ce4a2aa

Please sign in to comment.