-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Persistent centered mode (aka "Sticky Centering") #482
Conversation
unhorizontal-ling (gets of out center mode).
I would definitively add your suggestions since it is quite different behavior between "center it one time" and "always center the currently focused window". Also maybe add an option to enable it by default, for people that want that. Since this is also more like a "mode" now (that you can turn on/off). I think the the check |
Hey all, so I've implemented a nice(?) icon/indicator in the very left of the toolbar. You can click it now and it will switch between the modes (normal and centered). Give it a go and see what you think. I'm liking it thus far. |
I also added the shortcut |
space so shows up in Preview modes.
workspace switch previewing.
I will start testing this for the next couple of days. A couple of things I have noticed on first try:
|
Thanks @Lythenas for testing, always apprecaited! I really like the behaviour of this and use it quite a bit now.
The shortcut to toggle modes will work though on other monitors though.
Likely could - I haven't had the best luck with tooltips (I don't like the way it centers text - but that's mostly for multi line text). Would happily accept a PR on that branch if anyone wants to give it a go. I'll also give this a go and shout out if run into trouble on it. |
If it is hard to implement, it might not be worth it. I just thought the icon is probably not obvious.
I was thinking more like: If there is now empty space on the right/left when uncentering, move the window to the edge of the screen. I don't know how well remembering the original x position works. Because windows could be added/remove/moved since enabling the mode. But also you don't have to spent that much time adding new features here. I was just posting what came to mind. |
No, this is appreciated - and I think it's a good idea to see what feels better here. I'll try the |
Oh that's pretty interesting. So, I'm using the
Sounds like might need to - Thanks @Lythenas! Yeah, I'm quite enjoying it - I find myself using it fairly frequently on workspaces with quite disparate tasks (e.g. music, browsing etc.). |
can change with gnome ver or theme. Added improvement to space init - ensures correct layout with multimonitors and if gnome-shell resetting.
@Lythenas, can you test the latest (on Gnome 42 as well)? I'm now packaging the icons in PaperWM so should show icons correctly regardless of gnome version or theme. |
The icons was showing correctly for me on gnome 42, also before this change. So probably some theming issue as suggested |
Implemented! (well, my version of a tooltip... I forgot how not-great the gtk tooltips are - had trouble with them so just created an implementation myself that I think fits better). Let me know what you think (I wasn't sure what to put in the tooltip - maybe it's a bit verbose?). I think we're getting close to completing this feature. |
One slight issue with the tooltip: It appears on the wrong monitor :D My topbar is on the right monitor and the tooltip shows on the left monitor. But where I would expect it if I hover over the icon on that monitor. It also doesn't show up if I hover over the icon on my secondary monitor (which is probably also fine, we can improve the behavior if/when we decide how to do topbars on a seconary monitor). Also maybe make the tooltip background a bit more opaque. It was a little hard to read with my pinned firefox tabs in the background. Regarding the wrong icons: It could very well be a theming issue (although I think I didn't change anything). But since we are not using the icons for their original purpose I think it is good to bundle them with PaperWM. Just one note on that: Are we allowed to just copy them? What is the license on them? Maybe we need to include a notice somewhere. I would maybe put it either in a comment in the svgs or in a separate file next to the icons. |
Oh lol, yes I see - good pickup! (I usually don't use multi monitors - will fix that). FIXED ✔️
Well, given that icon is clickable (even on other monitors) it prob makes sense to have the tooltip show up on that monitor too.
Good call. Have a look at the
Good call - they're from |
multi-monitor setup).
icon information (with reference Gnome Project copying terms).
Yes, we can copy and package the icons - see COPY terms here: https://github.com/GNOME/adwaita-icon-theme/blob/master/COPYING I've added an Finally, I've now made the focus icon on secondary (etc.) monitor also show tooltip. |
Thanks all for testing thus far - please give the latest a test; I believe it's ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the behavior is now fine.
I will test the tooltip tomorrow and the probably approve.
Co-authored-by: Matthias Seiffert <matthias-seiffert@hotmail.de>
… reference to original names of icons used.
Oki-doki, updated ICONS.info with reference to original icon filenames used. Also, updated README.md with a small section on focus modes (including hiding the focus-mode button in topbar via dconf if users wish). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tooltip works well now.
FYI this is the tooltip definition for Adwaita: https://gitlab.gnome.org/GNOME/libadwaita/-/blob/main/src/stylesheet/widgets/_tooltip.scss They are using 0.8 transparency. But I think it is fine the way it is.
Fixes #503 This PR allows users to set the default focus mode (see #482) that is used when starting a gnome-session (with PaperWM enabled). This was meant to be part of #482 but I completely forgot about it :disappointed:. From the `README.md` of this PR: > ### Setting the default focus mode > > The default focus mode is the standard PaperWM focus mode (i.e. not centered). This can be changed according to preference by setting the `default-focus-mode` setting via `dconf` or `gsettings`. > > To set the default focus mode to `CENTER`, execute the following from a terminal: > ``` > dconf write /org/gnome/shell/extensions/paperwm/default-focus-mode 1 > ``` > > To undo to, or revert to the original PaperWM behaviour (by default), execute the following: > ``` > dconf write /org/gnome/shell/extensions/paperwm/default-focus-mode 0 > ``` > > _Note: changing this setting during a PaperWM session will set all spaces to the new default focus mode._ This PR also fixes a few minor issues/annoyances, such as aligning with `id` name for `show-window-position-bar` schema property, and correctly showing enabled options in the `Settings ui` (e.g. they can show enabled but the slider is in the "off" position while it's background shows it's on). _NOTE: this PR has been implemented in the [PaperWM-redux](https://github.com/PaperWM-redux/PaperWM) fork, which you can install if you want this, or any of [my PRs](https://github.com/paperwm/PaperWM/pulls/jtaala) that are open._
Fixes #332, #299.
So, this PR resurrects and updates the
sticky-center
branch. This basically continues to center windows (when switching to other windows) if the window was already centered (e.g. use the shortcut to center a window horizontally --> when switching to other windows they will be centered too).The updates I added disables this behaviour when using the center shortcut again (on a window that is already centered) - in which case it will "uncenter" that window (move it back to the left edge).See the video below - in the video I switch between "focus" mode and normal mode (see leftmost topbar icon, which is clickable to switch between modes btw). I'm clicking here but you can use a shortcut to switch between modes too:
paperwm-sticky-centering.mp4
First up, I really like this behaviour when I'm more just focusing on one window/task at a time (instead of looking at multiple side-by-side windows). However,
I'm setting this as a draft since I'm not entirely happy with it atm- it's a departure from current behaviour which is to center the current window but not enforce centering view when switching, and will likely confuse users when they try it.I would suggest:
having a separate shortcut to disable/enable a "focus center mode";✔️ implementedperhaps add an indicator icon (maybe at left-most position in the topbar) showing what mode PaperWM is in (e.g. centering mode or normal mode). Or just have it show up when in centering mode.✔️ implementedFeedback please!
NOTE: this PR has been implemented in the PaperWM-redux fork, which you can install if you want this, or any of my other open PRs.