Skip to content

Commit

Permalink
#4384 move screen init to init_randr()
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jan 5, 2025
1 parent e32f79d commit a965e13
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions xpra/x11/desktop/desktop_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def __init__(self):
self.root_prop_watcher = None
self.resize_value = -1, -1

def server_init(self) -> None:
super().server_init()
def init_randr(self) -> None:
super().init_randr()
from xpra.x11.vfb_util import set_initial_resolution
screenlog(f"server_init() randr={self.randr}, initial-resolutions={self.initial_resolutions}")
screenlog(f"init_randr() randr={self.randr}, initial-resolutions={self.initial_resolutions}")
if not RandR.has_randr() or not self.initial_resolutions or not features.display:
return
res = self.initial_resolutions
Expand Down
6 changes: 3 additions & 3 deletions xpra/x11/desktop/monitor_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def __init__(self):
self.reconfigure_timer: int = 0
self.reconfigure_locked: bool = False

def server_init(self) -> None:
super().server_init()
def init_randr(self) -> None:
super().init_randr()
from xpra.x11.vfb_util import set_initial_resolution
screenlog(f"server_init() randr={self.randr}, initial-resolutions={self.initial_resolutions}")
screenlog(f"init_randr() randr={self.randr}, initial-resolutions={self.initial_resolutions}")
if not RandR.has_randr() or not self.initial_resolutions:
return
res = self.initial_resolutions
Expand Down
11 changes: 6 additions & 5 deletions xpra/x11/server/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ def x11_init(self) -> None:
with xsync:
self.init_x11_atoms()
with xlog:
if self.randr:
self.init_randr()
self.init_randr()
with xlog:
self.init_cursor()
with xlog:
Expand All @@ -178,8 +177,11 @@ def save_mode(self) -> None:
save_mode(self.get_server_mode())

def init_randr(self) -> None:
self.randr = RandR.has_randr()
if self.randr and not RandR.has_randr():
self.randr = False
screenlog("randr=%s", self.randr)
if not self.randr:
return
# check the property first,
# because we may be inheriting this display,
# in which case the screen sizes list may be longer than 1
Expand All @@ -198,8 +200,7 @@ def init_randr(self) -> None:
# xwayland?
self.randr = False
self.randr_exact_size = False
screenlog("randr=%s, exact size=%s", self.randr, self.randr_exact_size)
screenlog("randr enabled: %s", self.randr)
screenlog(f"randr enabled: {self.randr}, exact size={self.randr_exact_size}")
if not self.randr:
screenlog.warn("Warning: no X11 RandR support on %s", os.environ.get("DISPLAY"))

Expand Down

0 comments on commit a965e13

Please sign in to comment.