Skip to content

Commit

Permalink
#565: if glEnablei is not available, disable alpha which is the only …
Browse files Browse the repository at this point in the history
…place that uses it

git-svn-id: https://xpra.org/svn/Xpra/trunk@6343 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 4, 2014
1 parent 56d591a commit e69768a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/xpra/client/gl/gl_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ def redirect_log(logger_name):
glMultiTexCoord2i, \
glVertex2i, glEnd)

glEnablei = None
try:
from OpenGL.GL import glEnablei
except:
pass
if not bool(glEnablei):
log.warn("OpenGL glEnablei is not available, disabling transparency")
global HAS_ALPHA
HAS_ALPHA = False

#check for framebuffer functions we need:
from OpenGL.GL.ARB.framebuffer_object import GL_FRAMEBUFFER, \
GL_COLOR_ATTACHMENT0, glGenFramebuffers, glBindFramebuffer, glFramebufferTexture2D
Expand Down
4 changes: 3 additions & 1 deletion src/xpra/client/gl/gl_window_backing.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ def py_gl_debug_callback(source, error_type, error_id, severity, length, message
class GLPixmapBacking(GTK2WindowBacking):

def __init__(self, wid, w, h, has_alpha):
GTK2WindowBacking.__init__(self, wid, w, h, has_alpha)
display_mode = get_DISPLAY_MODE()
try:
self.glconfig = gtk.gdkgl.Config(mode=display_mode)
except gtk.gdkgl.NoMatches:
display_mode &= ~gtk.gdkgl.MODE_DOUBLE
self.glconfig = gtk.gdkgl.Config(mode=display_mode)
if not self.glconfig.has_alpha():
has_alpha = False
GTK2WindowBacking.__init__(self, wid, w, h, has_alpha)
self._backing = gtk.gtkgl.DrawingArea(self.glconfig)
#restoring missed masks:
self._backing.set_events(self._backing.get_events() | gdk.POINTER_MOTION_MASK | gdk.POINTER_MOTION_HINT_MASK)
Expand Down

0 comments on commit e69768a

Please sign in to comment.