Skip to content

Commit

Permalink
* rename GLContextManager to GtkGLExtContext since it is tied to this…
Browse files Browse the repository at this point in the history
… library

* don't reimport glib

git-svn-id: https://xpra.org/svn/Xpra/trunk@16926 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 19, 2017
1 parent fc7ebe8 commit 2391ba4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/xpra/client/gl/gtk_base/gtk_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def Config_new_by_mode(display_mode):
log("no configuration for mode: %s", e)
return None

class GLContextManager(object):
class GtkGLExtContext(object):

def __init__(self, widget):
self.widget = widget
Expand All @@ -52,7 +52,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
#GtkGLExt.widget_end_gl(self.widget, False)
pass
def __repr__(self):
return "gtk3.GLContextManager(%s)" % self.widget
return "gtk3.GtkGLExtContext(%s)" % self.widget

else:
import gtk
Expand Down Expand Up @@ -83,7 +83,7 @@ def v(x):
"gdkgl" : v(gdkgl.query_version())
}

class GLContextManager(object):
class GtkGLExtContext(object):

def __init__(self, widget):
self.widget = widget
Expand All @@ -99,7 +99,7 @@ def __exit__(self, *_args):
self.gldrawable.gl_end()

def __repr__(self):
return "gtk2.GLContextManager(%s)" % self.widget
return "gtk2.GtkGLExtContext(%s)" % self.widget

def GLDrawingArea(glconfig):
assert glconfig, "missing GLConfig"
Expand Down
4 changes: 2 additions & 2 deletions src/xpra/client/gl/gtk_base/gtkgl_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ def check_functions(*functions):

#sanity checks: OpenGL version and fragment program support:
def check_GL_support(widget, force_enable=False):
from xpra.client.gl.gtk_base.gtk_compat import GLContextManager
with GLContextManager(widget):
from xpra.client.gl.gtk_base.gtk_compat import GtkGLExtContext
with GtkGLExtContext(widget):
return check_PyOpenGL_support(force_enable)

def check_support(force_enable=False, check_colormap=False):
Expand Down
6 changes: 3 additions & 3 deletions src/xpra/client/gl/gtk_base/gtkgl_window_backing_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

from xpra.gtk_common.gtk_util import POINTER_MOTION_MASK, POINTER_MOTION_HINT_MASK
from xpra.client.gl.gl_window_backing_base import GLWindowBackingBase
from xpra.client.gl.gtk_base.gtk_compat import Config_new_by_mode, MODE_DOUBLE, GLContextManager, GLDrawingArea
from xpra.client.gl.gtk_base.gtk_compat import Config_new_by_mode, MODE_DOUBLE, GtkGLExtContext, GLDrawingArea
from xpra.client.gl.gtk_base.gtkgl_check import get_DISPLAY_MODE
from xpra.client.gl.gl_check import GL_ALPHA_SUPPORTED, CAN_DOUBLE_BUFFER


class GTKGLWindowBackingBase(GLWindowBackingBase):

def idle_add(self, *args, **kwargs):
import_glib().idle_add(*args, **kwargs)
glib.idle_add(*args, **kwargs)

def init_gl_config(self, window_alpha):
#setup gl config:
Expand Down Expand Up @@ -95,7 +95,7 @@ def gl_context(self):
log.error("Error: invalid OpenGL backing size: %ix%i", w, h)
return None
try:
context = GLContextManager(b)
context = GtkGLExtContext(b)
except Exception as e:
log.error("Error: %s", e)
return None
Expand Down

0 comments on commit 2391ba4

Please sign in to comment.