-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window placement in floating mode #73
Comments
I found that this centers the windows in floating mode, and they behave appropriately when dragged. I don't know this code very well though, so perhaps this will cause other issues. If someone implemented a way to specify "floating_mode (center|corner)" as you suggest, then I think that this might be a really simple fix. // clientlist.cpp
void client_resize_floating(HSClient* client, HSMonitor* m) {
// ...
Rectangle rect = client->float_size;
+ rect.x += (m->rect.width - rect.width)/2;
+ rect.y += (m->rect.height - rect.height)/2;
rect.x += m->rect.x;
rect.x += m->rect.y;
// ...
I have tested this only on a basic one monitor setup. |
Right now, hlwm positions a new floating window the way the window itselfs suggests it. That's why terminal windows are placed in the top right corner and other windows in the monitor center. But it's a todo for me to have this overwritable by rules. |
Alright, thank you both for replying. :) I might have a go at this myself and make a pull request. |
@blairdrummond, because of your post I was motivated to try this solution. It does work somewhat in a one monitor scenario, but resizing starts behaving very weirdly (resizing from window center, instead of upper left corner, etc). In a multi monitor setup, it only functions on the primary monitor. I did however find what I think is the way to fix this. Perhaps @t-wissmann, can spot some suble mistake, but I run this now on a multi-monitor setup, without any problems I place it here, so that people annoyed by this behaviour can patch the 7.0 release and move on with their lives, whilst waiting for WinterBreeze
|
This issue is quite old and I can't find anything in the docs. Are there any updates on this? I open quite a few CLI programs via click actions in my Polybar: I've set a rule: Right now they all open in the top left corner (due to them being launched inside a terminal emulator, I assume). So I also think being able to set rules for the placement (e.g., |
No, sorry for letting you wait!
Yes, |
This implements feature request #73 and adds a rule consequence 'placement' that updates the floating position of a client, possibly overwriting the position requested by the client itself (which is not to be trusted in most cases, or even is simply (0,0) for terminals).
This implements feature request #73 and adds a rule consequence 'floatplacement' that updates the floating position of a client, possibly overwriting the position requested by the client itself (which is not to be trusted in most cases, or even is simply (0,0) for terminals).
This can be closed with #957 being merged, right? |
#957 only implements I think another useful one could be |
Do you really need the corners? I'm hesitating to implement (and to write tests for) something that only might be useful at some point in the future. |
I don't need the corners myself, it's just that it was mentionned by @bklaase in his first post of the issue, so I wanted to remind you about it! However the |
yeah, no to be honest I am very grateful for the feature as is, and the rest of my initial post is (in hindsight) just rambling ;) I'll close this, for bookkeeping, sorry to have left it open :) |
I see! No Worries! :) |
This adds a new option 'smart' for the rule consequence floatplacement. It tries to place the floating window with as little overlap to other floating windows as possible. Beside documentation, this also adds test cases. Smart window placement is quite hard to test, so I have two test cases that actually verify the window positions, and one test case that only adds a bunch of clients without verifying anything (not contributing to code coverage). This has been requested in #73.
is this feature available in v0.8.3? |
No, you need the current git-version for this feature, @Piping |
Current strategy seems to be to place windows in the top left of the current monitor. While it was the easiest thing in the world to create a hook, and subsequently a script that gets triggered on windows with certain conditions (i.e. no size hints for location), that centres the window, this has a disadvantage. When I do this there is an almost unnoticeable movement before the window moves to the centre of the monitor. With a compton fade effect not so much noticable, without it, it looks quite clunky. Would it be possible (maybe in next release) to implement placement strategy natively in the WM ?
Possible values could be:
The text was updated successfully, but these errors were encountered: