Comments (20)
I've just tried MoveTo
with xterm and it works fine here.
from labwc.
Maybe my syntax is wrong? I'm trying to move Thunderbird (AppImage of an old gtk2 version) using this rule in ~/.config/labwc/rc.xml
, just as an example:
<windowRules>
<windowRule identifier="" title="Thunderbird"><action name="MoveTo" x="10" y="10" /></windowRule>
</windowRules>
Definitely not working for me. The window opens in the center of my laptop's screen. What gives?
P.S. I'll try with xterm to remove any confounding factors.
from labwc.
The syntax is correct and it works with xterm.
Hmm, with Thunderbird (gtk2-based, xwayland app) and with Xfe (fox-based, xwayland app) ResizeTo
and MoveTo
do not work at all. Any ideas?
from labwc.
Are you sure the identifier / title is correct. Might not work with identifier=""
Run labwc -d
to see the identifier + title when you launch (map) an application.
from labwc.
Just a guess, maybe the title is not correct during startup and thus the Thunderbird
rule doesn't match.
You could try to use the identifier rather than the title, see wlrctl window list
.
from labwc.
Thank you both.
$ wlrctl window list
foot: foot
Thunderbird: Inbox - Mozilla Thunderbird
<windowRule identifier="Thunderbird"><action name="ResizeTo" width="900" height="550" /><action name="MoveTo" x="10" y="10" /></windowRule>
Now it works!
I assumed the output of wlrctl window list
were titles. What's the difference between "identifier" and "title" in this context?
from labwc.
I assumed the output of
wlrctl window list
were titles. What's the difference between "identifier" and "title" in this context?
The title may change randomly, for example in thunderbird it looks like you'd get a new title when you change the folder.
The identifier
(or app_id
/ WM_CLASS
) is usually the same during the runtime of the application.
Edit:
Just to clarify, you could likely still use the title with something like title="*Thunderbird*"
but I'd always recommend to only use the identifier unless there are reasons not to (for example when you only want to match a specific window of a multi window application).
from labwc.
I assumed the output of
wlrctl window list
were titles. What's the difference between "identifier" and "title" in this context?
Depends on the client. If you run labwc
nested (from the terminal) you can see what they are.
from labwc.
Thank you both very much--not only for helping me solve my issue, but also for sharing your knowledge. Many thanks! Happy hacking!
from labwc.
Darn, I found another unexpected behavior related to this.
Here is the rule:
<windowRule identifier="" title="Write:*"><action name="ResizeTo" width="800" height="400" /><action name="MoveTo" x="300" y="200" /></windowRule>
Here is relevant output from wlrctl
:
$ wlrctl window list
foot: foot
Thunderbird: Write: (no subject)
Thunderbird: Inbox - Mozilla Thunderbird
brave-browser: ResizeTo and MoveTo actions not working for xwayland windows · Issue #1446 · labwc/labwc - Brave
Rule works when I compose first email in Thunderbird. When I go to compose second and subsequent emails, the window with "Write:*" in the title is the correct size but opens at location 0,0 (at top-left corner, with titlebar and minimize/maximize/close buttons off the screen). I tried using "identifier" instead of "title" in the rule, but it didn't help. Any ideas what's going on here?
from labwc.
matchOnce
?
https://labwc.github.io/labwc-config.5.html#entry_matchonce
from labwc.
Not sure why this is happening. In general I'd suggest using SnapToRegion
rather than the ResizeTo
and MoveTo
combination.
from labwc.
Thanks for the tip, but no luck. I tried rule with matchOnce="false"
as well as with matchOnce="true"
, both times got the same unexpected behavior (MoveTo
action working only on first email that I write).
I'll give SnapToRegion
a try.
from labwc.
SnapToRegion
works reliably, but only if I don't move the window. If I do move it, subsequent "Write" windows open at 0,0.
I have a theory: I think this is Tbird interfering by trying to "help" the user by remembering where the Write window is moved to. Whatever algorithm Tbird is using for window location doesn't work in Xwayland, so window ends up at 0,0 when Tbird tries to move the window to the place it was last moved to.
For whatever reason, SnapToRegion
is able to put the window where user wants it to be, without Tbird being able to detect that the window was moved.
from labwc.
I experimented a lot more and can confirm that Thunderbird is interfering by trying to move windows to where they were last moved to, but is doing so using incorrect coordinates. There does not seem to be any Thunderbird setting that disables this annoying behavior, despite many settings with promising names in the advanced configuration editor (about:config).
Is there any window rule that makes labwc take full control of window placement, forbidding applications from interfering? If not, maybe there a way to introduce a slight delay before a windowRule action
(so that labwc moves/resizes the window after the application has done so)?
from labwc.
Seems to me the best solution would be kicking Thunderbird to the curb. 🤣
I recently discovered a use case for a Delay
actions which could hack around some misbehaviors. Not sure about the others, but I could be persuaded that such an action has value.
from labwc.
Seems to me the best solution would be kicking Thunderbird to the curb. 🤣
I've considered that. All GUI email clients are terrible, but so far I've found Thunderbird to be the least terrible.
Regarding a Delay
action, I'd really love it. I don't want to fight with buggy applications or swap them out. I'd rather just trample on their misbehavior with window rules.
from labwc.
Related Issues (20)
- Applications overlap bottom-placed-status-bars (waybar, sfwbar) at launch. However, they don't overlap top-placed status bars. HOT 4
- Keyboard layout is stuck in Great Britain English and I can't change it to US HOT 4
- labwc-config(5): describe tablet configuration HOT 1
- how to query current keyboard layout? HOT 2
- tablet: Add pen/pad button bindings HOT 4
- tablet: Add output mapping HOT 1
- System vs user configuration HOT 25
- On-the-fly keyboard layout changes? HOT 13
- Couple of issues with new VRR behavior HOT 3
- Touchscreen association with output device HOT 23
- Crash on VT switch on FreeBSD HOT 16
- [Feature request] Menu accelerators HOT 2
- [Feature request] Directional focus HOT 4
- [Feature Requests] libinput send events configuration HOT 1
- [Idea] Move wiki repository tab to labwc.github.io HOT 2
- [Idea/question] Main difference between the README contents and the website contents?
- [Idea] Expand more the integration page
- leafpad crashing under labwc 0.7.0 (segfault?) HOT 10
- [Void] Fonts Do Not Render, and Terminal Does Not Open Upon Startup HOT 2
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 labwc.