Skip to content

Commit

Permalink
#2721 don't enable opengl for: small windows, transient-for windows, …
Browse files Browse the repository at this point in the history
…windows from the NO_OPENGL_WINDOW_TYPES list

git-svn-id: https://xpra.org/svn/Xpra/trunk@26044 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 8, 2020
1 parent 3d62474 commit 4ff0a47
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/xpra/client/gtk_base/gtk_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from xpra.client.gtk_base.gtk_client_window_base import HAS_X11_BINDINGS, XSHAPE
from xpra.gtk_common.quit import gtk_main_quit_really, gtk_main_quit_on_fatal_exceptions_enable
from xpra.util import (
updict, pver, iround, flatten_dict, envbool, repr_ellipsized, csv, first_time, typedict,
updict, pver, iround, flatten_dict,
envbool, envint, repr_ellipsized, csv, first_time, typedict,
DEFAULT_METADATA_SUPPORTED, XPRA_OPENGL_NOTIFICATION_ID,
)
from xpra.os_util import (
Expand Down Expand Up @@ -61,6 +62,9 @@
EXPORT_ICON_DATA = envbool("XPRA_EXPORT_ICON_DATA", True)
SAVE_CURSORS = envbool("XPRA_SAVE_CURSORS", False)
CLIPBOARD_NOTIFY = envbool("XPRA_CLIPBOARD_NOTIFY", True)
OPENGL_MIN_SIZE = envint("XPRA_OPENGL_MIN_SIZE", 32)
NO_OPENGL_WINDOW_TYPES = os.environ.get("XPRA_NO_OPENGL_WINDOW_TYPES",
"DOCK,TOOLBAR,MENU,UTILITY,SPLASH,DROPDOWN_MENU,POPUP_MENU,TOOLTIP,NOTIFICATION,COMBO,DND").split(",")


class GTKXpraClient(GObjectXpraClient, UIXpraClient):
Expand Down Expand Up @@ -1125,6 +1129,18 @@ def get_client_window_classes(self, w, h, metadata, override_redirect):
ms = min(self.sx(self.gl_texture_size_limit), *self.gl_max_viewport_dims)
if w>ms or h>ms:
return (self.ClientWindowClass,)
#avoid opengl for small windows:
if w<=OPENGL_MIN_SIZE or h<=OPENGL_MIN_SIZE:
log.warn("not using opengl for small window: %ix%i", w, h)
return (self.ClientWindowClass,)
#avoid opengl for tooltips:
window_types = metadata.strtupleget("window-type")
if any(x in (NO_OPENGL_WINDOW_TYPES) for x in window_types):
log("not using opengl for %s window-type", csv(window_types))
return (self.ClientWindowClass,)
if metadata.intget("transient-for", 0)>0:
log("not using opengl for transient-for window")
return (self.ClientWindowClass,)
if WIN32:
#win32 opengl doesn't do alpha (not sure why):
if override_redirect:
Expand Down

0 comments on commit 4ff0a47

Please sign in to comment.