-
-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1443: implement config.get_depth in gtkglext and expose it in pygtkg…
…lext git-svn-id: https://xpra.org/svn/Xpra/trunk@15375 3bb7dfac-3a0b-4e04-842a-767bc560f471
- Loading branch information
Showing
3 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters