Skip to content

Commit

Permalink
Merge pull request #76 from ReaperMantis/master
Browse files Browse the repository at this point in the history
Check for property WM_NAME if _NET_WM_NAME property does not return a value
  • Loading branch information
Kalmat authored Sep 12, 2023
2 parents d011545 + a26c7f8 commit 1e1263a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ewmhlib/Props.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class DesktopLayout(IntEnum):

class Window:
NAME = "_NET_WM_NAME"
LEGACY_NAME = "WM_NAME"
VISIBLE_NAME = "_NET_WM_VISIBLE_NAME"
ICON_NAME = "_NET_WM_ICON_NAME"
VISIBLE_ICON_NAME = "_NET_WM_VISIBLE_ICON_NAME"
Expand Down
4 changes: 4 additions & 0 deletions src/ewmhlib/_ewmhlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,10 @@ def getName(self) -> Optional[str]:
"""
ret: Optional[Xlib.protocol.request.GetProperty] = self.getProperty(Window.NAME)
res: Optional[Union[List[int], List[str]]] = getPropertyValue(ret, display=self.display)
if res:
return str(res[0])
ret = self.getProperty(Window.LEGACY_NAME)
res = getPropertyValue(ret, display=self.display)
if res:
return str(res[0])
return None
Expand Down

0 comments on commit 1e1263a

Please sign in to comment.