Comments (3)
This is easily fixed by padding the desired title to the required length:
title += "\0" * (20 - len(title))
Maybe setWmName
could be changed to do this automatically:
diff --git a/ewmh/ewmh.py b/ewmh/ewmh.py
index 1302ae6..da149ef 100644
--- a/ewmh/ewmh.py
+++ b/ewmh/ewmh.py
@@ -133,6 +133,7 @@ class EWMH:
:param win: the window object
:param name: desired name"""
+ name += '\0' * (20 - len(name))
self._setProperty('_NET_WM_NAME', name, win)
def setWmVisibleName(self, win, name):
from pyewmh.
Ok, thanks, there is no error with your fix... But it doesn't rename the window.
I don't really understand why the length title needs to be fixed to 20 chars.
setWmName is not intended to rename windows.
According to pyewmh sources, setWmName() refers to the _NET_WM_NAME
proterty, which is, according to the EWMH specs, should rename a window:
The Client SHOULD set this to the title of the window in UTF-8 encoding. If set, the Window Manager should use this in preference to WM_NAME.
from pyewmh.
See X11’s documentation, D.5. The ClientMessage event's format:
char data.b[20] (read/write DATA : MAX 20 byte)
If the data is smaller than 20 byte, all data other than available data must be 0.
Python’s Xlib implementation accordingly sets ClientMessage to use a fixed data size of 20:
class ClientMessage(rq.Event):
# ...
rq.FixedPropertyData('data', 20)
from pyewmh.
Related Issues (14)
- Please deprecate SourceForge project HOT 2
- Empty list/None incompatibility HOT 2
- Typo? HOT 1
- Error at getWmWindowTypes HOT 4
- Xlib.error.ConnectionClosedError: Display connection closed by server HOT 2
- Can I move + resize a window using this ? HOT 1
- Empty chromium and chrome get_wm_name. HOT 2
- setMoveResizeWindow gravity flags faulty.
- Attempting to activate windows with EWMH().setActiveWindow(window) on KDE Plasma.
- Desktop Geometry/WorkArea Issue
- No support for _NET_DESKTOP_NAMES HOT 1
- [BUG] Missing handling of case where no property is obtained within getWmPid HOT 1
- `getClientListStacking` in WSL2 raises `TypeError: 'NoneType' object is not iterable`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyewmh.