Skip to content

Commit

Permalink
#2438 blacklist some xsettings that cause problems (ie: window scaling)
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@24133 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 14, 2019
1 parent edd1f26 commit b1c88a5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/xpra/x11/x11_server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from xpra.gtk_common.error import xswallow, xsync, xlog
from xpra.x11.x11_server_core import X11ServerCore, XTestPointerDevice
from xpra.x11.bindings.keyboard_bindings import X11KeyboardBindings #@UnresolvedImport
from xpra.x11.xsettings_prop import XSettingsTypeInteger, XSettingsTypeString
from xpra.x11.xsettings_prop import XSettingsTypeInteger, XSettingsTypeString, BLACKLISTED_XSETTINGS
from xpra.log import Logger

log = Logger("x11", "server")
Expand Down Expand Up @@ -291,6 +291,9 @@ def do_update_server_settings(self, settings, reset=False,
if len(parts)!=2:
log("skipped invalid option: '%s'", option)
continue
if parts[0] in BLACKLISTED_XSETTINGS:
log("skipped blacklisted option: '%s'", option)
continue
values[parts[0]] = parts[1]
if cursor_size>0:
values["Xcursor.size"] = cursor_size
Expand Down Expand Up @@ -328,6 +331,17 @@ def do_update_server_settings(self, settings, reset=False,
#(as those may not be present in xsettings on some platforms.. like win32 and osx)
if k==b"xsettings-blob" and \
(self.double_click_time>0 or self.double_click_distance!=(-1, -1) or antialias or dpi>0):
#start by removing blacklisted options:
def filter_blacklisted():
serial, values = v
new_values = []
for _t,_n,_v,_s in values:
if bytestostr(_n) in BLACKLISTED_XSETTINGS:
log("skipped blacklisted option %s", (_t, _n, _v, _s))
else:
new_values.append((_t, _n, _v, _s))
return serial, new_values
v = filter_blacklisted()
def set_xsettings_value(name, value_type, value):
#remove existing one, if any:
serial, values = v
Expand Down
3 changes: 3 additions & 0 deletions src/xpra/x11/xsettings_prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
It is used by xpra.x11.gtk_x11.prop
"""

import os
import sys
import struct

Expand All @@ -25,6 +26,8 @@
log = Logger("x11", "xsettings")

DEBUG_XSETTINGS = envbool("XPRA_XSETTINGS_DEBUG", False)
BLACKLISTED_XSETTINGS = os.environ.get("XPRA_BLACKLISTED_XSETTINGS",
"Gdk/WindowScalingFactor,Gtk/SessionBusId,Gtk/IMModule").split(",")


#undocumented XSETTINGS endianess values:
Expand Down

0 comments on commit b1c88a5

Please sign in to comment.