Skip to content

Commit

Permalink
expose X11 errors and import from correct module
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Feb 1, 2024
1 parent b239e2f commit b0b9578
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions xpra/x11/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

from xpra.os_util import gi_import
from xpra.common import WORKSPACE_UNSET, WORKSPACE_ALL
from xpra.x11.models.core import CoreX11WindowModel, xswallow, Above, RESTACKING_STR
from xpra.gtk.error import xsync, xlog
from xpra.x11.models.core import CoreX11WindowModel, Above, RESTACKING_STR
from xpra.x11.bindings.window import X11WindowBindings, constants
from xpra.server.window.content_guesser import guess_content_type, get_content_type_properties
from xpra.x11.gtk3.bindings import get_pywindow, get_pyatom
Expand Down Expand Up @@ -318,7 +319,7 @@ def move_to_workspace(self, workspace: int) -> None:
workspacelog("move_to_workspace(%s) unchanged", workspacestr(workspace))
return
workspacelog("move_to_workspace(%s) current=%s", workspacestr(workspace), workspacestr(current))
with xswallow:
with xlog:
if workspace == WORKSPACE_UNSET:
workspacelog("removing _NET_WM_DESKTOP property from window %#x", self.xid)
self.prop_del("_NET_WM_DESKTOP")
Expand All @@ -333,13 +334,13 @@ def move_to_workspace(self, workspace: int) -> None:
def _sync_state(self, *_args) -> None:
state = self.get_property("state")
metalog("sync_state: setting _NET_WM_STATE=%s on %#x", state, self.xid)
with xswallow:
with xlog:
self.prop_set("_NET_WM_STATE", ["atom"], state)

def _sync_iconic(self, *_args) -> None:
def set_state(state):
log("_handle_iconic_update: set_state(%s)", state)
with xswallow:
with xlog:
self.prop_set("WM_STATE", "state", state)

if self.get("iconic"):
Expand Down Expand Up @@ -410,7 +411,7 @@ def _handle_opacity_change(self) -> None:
self._updateprop("opacity", opacity)

def _handle_wm_hints_change(self) -> None:
with xswallow:
with xsync:
wm_hints = X11Window.getWMHints(self.xid)
metalog("getWMHints(%#x)=%s", self.xid, wm_hints)
if wm_hints is None:
Expand Down

0 comments on commit b0b9578

Please sign in to comment.