Skip to content
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

[BUG] layout_center: centered window to big #55

Closed
nsyring opened this issue Mar 1, 2024 · 6 comments
Closed

[BUG] layout_center: centered window to big #55

nsyring opened this issue Mar 1, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@nsyring
Copy link

nsyring commented Mar 1, 2024

Pyprland version
Which version did you use?
2.0.5
Describe the bug
A clear and concise description of what the bug is.
I am using the layout_center plugin configured as mentioned in the wiki.
When activation the layout_center the Windows which should be centered is resized above the right an bottom screen boundaries.
To Reproduce
Steps to reproduce the behavior:
Activate the layout_center plugin.

Expected behavior
A centered window with a margin from the screen on each side of the window.

Configuration (provide following files/samples when relevant):

  • pyprland.toml
    [pyprland]
    plugins = [
    "scratchpads",
    "toggle_special",
    "layout_center",

"monitors",

"shift_monitors",

"workspaces_follow_focus",

"expose"
]

[workspaces_follow_focus]
max_workspaces = 9 # number of workspaces before cycling

[scratchpads.volume]
lazy = true
command = "pavucontrol"
class = "volume"
unfocus = "hide"
animation = "fromBottom"

[scratchpads.term]
lazy=true
command = "kitty --class kitty-dropterm"
class = "term"
animation = "fromTop"
unfocus = "keep"

[scratchpads.logseq]
command = "logseq"
class = "Logseq"
animation = "fromTop"
unfocus = "keep"
lazy = true

[scratchpads.stb]
animation = "fromBottom"
class = "kitty-stb"
lazy = true
command = "kitty --class kitty-stb sstb"

[scratchpads.stb-logs]
animation = "fromTop"
class = "kitty-stb-logs"
lazy = true
command = "kitty --class kitty-stb-logs stbLog"

[layout_center]

margin = 100

offset = [0, 0]

next = "movefocus r"
prev = "movefocus l"
next2 = "movefocus d"
prev2 = "movefocus u"`

  • hyprland.conf
    bind = $mainMod, M, exec, pypr layout_center toggle # toggle the layout

focus change keys

bind = $mainMod, left, exec, pypr layout_center prev
bind = $mainMod, right, exec, pypr layout_center next
bind = $mainMod, up, exec, pypr layout_center prev2
bind = $mainMod, down, exec, pypr layout_center next2
Additional context
Add any other context about the problem here.

@nsyring nsyring added the bug Something isn't working label Mar 1, 2024
@nsyring nsyring changed the title [BUG] Enter a short bug description here [BUG] layout_center: centered window to big Mar 1, 2024
@fdev31
Copy link
Collaborator

fdev31 commented Mar 1, 2024

I can't reproduce that behavior here.

You may need to provide full pypr logs and the output of:

  • hyprctl clients -j
  • hyprctl monitors -j

When you change the focused window (with Mod + arrow) is the problem reproduced on the next window ?

Are you using scaling on monitors ?

@nsyring
Copy link
Author

nsyring commented Mar 1, 2024

Wow this is a fast response time! :-)
here are the logs:
[{ "address": "0x5e44182cba40", "mapped": false, "hidden": false, "at": [0, 0], "size": [0, 0], "workspace": { "id": -1, "name": "" }, "floating": false, "monitor": -1, "class": "", "title": "", "initialClass": "", "initialTitle": "", "pid": -1, "xwayland": true, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": -1 },{ "address": "0x5e44182d3a40", "mapped": false, "hidden": false, "at": [0, 0], "size": [0, 0], "workspace": { "id": -1, "name": "" }, "floating": false, "monitor": -1, "class": "", "title": "", "initialClass": "", "initialTitle": "", "pid": -1, "xwayland": true, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": -1 },{ "address": "0x5e441836a5d0", "mapped": true, "hidden": false, "at": [10, 533], "size": [1579, 846], "workspace": { "id": -95, "name": "special:minimized" }, "floating": false, "monitor": 0, "class": "com.nextcloud.desktopclient.nextcloud", "title": "Nextcloud", "initialClass": "com.nextcloud.desktopclient.nextcloud", "initialTitle": "Nextcloud", "pid": 18641, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 21 },{ "address": "0x5e44184406d0", "mapped": true, "hidden": false, "at": [5924, 48], "size": [785, 846], "workspace": { "id": 3, "name": "3" }, "floating": false, "monitor": 0, "class": "Mattermost", "title": "Mattermost Desktop App", "initialClass": "Mattermost", "initialTitle": "Mattermost Desktop App", "pid": 40855, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 17 },{ "address": "0x5e4416f461e0", "mapped": true, "hidden": false, "at": [5130, 48], "size": [786, 419], "workspace": { "id": 3, "name": "3" }, "floating": false, "monitor": 0, "class": "chrome-censored_webclient_-Default", "title": "censored", "initialClass": "chrome-censored__webclient_-Default", "initialTitle": "censored", "pid": 44195, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 16 },{ "address": "0x5e4416f0d3d0", "mapped": true, "hidden": false, "at": [5130, 475], "size": [786, 419], "workspace": { "id": 3, "name": "3" }, "floating": false, "monitor": 0, "class": "chrome-teams.microsoft.com___-Default", "title": "censored", "initialClass": "chrome-teams.microsoft.com___-Default", "initialTitle": "teams.microsoft.com_/_", "pid": 46117, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 18 },{ "address": "0x5e44188a6dc0", "mapped": true, "hidden": false, "at": [3888, 918], "size": [1222, 512], "workspace": { "id": 2, "name": "2" }, "floating": false, "monitor": 1, "class": "kitty", "title": "~", "initialClass": "kitty", "initialTitle": "zsh", "pid": 261873, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 8 },{ "address": "0x5e44188b2a30", "mapped": true, "hidden": false, "at": [10, 43], "size": [653, 1387], "workspace": { "id": 1, "name": "1" }, "floating": false, "monitor": 2, "class": "kitty", "title": "censored ~", "initialClass": "kitty", "initialTitle": "zsh", "pid": 263216, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 13 },{ "address": "0x5e44184d0890", "mapped": true, "hidden": true, "at": [671, 325], "size": [1879, 1105], "workspace": { "id": 1, "name": "1" }, "floating": false, "monitor": 2, "class": "firefox", "title": "Editing vim-oscyank/README.md at main · ojroques/vim-oscyank – Mozilla Firefox", "initialClass": "firefox", "initialTitle": "Mozilla Firefox", "pid": 48062, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": ["0x5e4418534280", "0x5e44184d0890", "0x5e4418544440", "0x5e4418535f50"], "swallowing": "0x0", "focusHistoryID": 10 },{ "address": "0x5e4418544440", "mapped": true, "hidden": true, "at": [671, 325], "size": [1879, 1105], "workspace": { "id": 1, "name": "1" }, "floating": false, "monitor": 2, "class": "firefox", "title": "Variables | Hyprland Wiki – Mozilla Firefox", "initialClass": "firefox", "initialTitle": "Mozilla Firefox", "pid": 48062, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": ["0x5e4418534280", "0x5e44184d0890", "0x5e4418544440", "0x5e4418535f50"], "swallowing": "0x0", "focusHistoryID": 12 },{ "address": "0x5e4418535f50", "mapped": true, "hidden": false, "at": [671, 325], "size": [1879, 1105], "workspace": { "id": 1, "name": "1" }, "floating": false, "monitor": 2, "class": "firefox", "title": "[BUG] layout_center: centered window to big · Issue #55 · hyprland-community/pyprland – Mozilla Firefox", "initialClass": "firefox", "initialTitle": "Mozilla Firefox", "pid": 48062, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": ["0x5e4418534280", "0x5e44184d0890", "0x5e4418544440", "0x5e4418535f50"], "swallowing": "0x0", "focusHistoryID": 3 },{ "address": "0x5e44188e12b0", "mapped": true, "hidden": false, "at": [671, 43], "size": [1879, 253], "workspace": { "id": 1, "name": "1" }, "floating": false, "monitor": 2, "class": "kitty", "title": "~", "initialClass": "kitty", "initialTitle": "zsh", "pid": 494678, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 11 },{ "address": "0x5e44186567b0", "mapped": true, "hidden": false, "at": [3888, 43], "size": [1222, 867], "workspace": { "id": 2, "name": "2" }, "floating": false, "monitor": 1, "class": "chrome-censored-Default", "title": "censored", "initialClass": "censored__owa-Default", "initialTitle": "censored", "pid": 227948, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 7 },{ "address": "0x5e44187c4090", "mapped": true, "hidden": false, "at": [2570, 43], "size": [1310, 1387], "workspace": { "id": 2, "name": "2" }, "floating": false, "monitor": 1, "class": "kitty", "title": "~", "initialClass": "kitty", "initialTitle": "zsh", "pid": 113483, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 4 },{ "address": "0x5e44188d9c50", "mapped": true, "hidden": false, "at": [4674, 43], "size": [436, 1387], "workspace": { "id": 5, "name": "5" }, "floating": false, "monitor": 1, "class": "org.remmina.Remmina", "title": "Remmina Remote-Desktop Client", "initialClass": "org.remmina.Remmina", "initialTitle": "Remmina Remote-Desktop Client", "pid": 854971, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 20 },{ "address": "0x5e4418534280", "mapped": true, "hidden": true, "at": [671, 325], "size": [1879, 1105], "workspace": { "id": 1, "name": "1" }, "floating": false, "monitor": 2, "class": "firefox", "title": "nosduco/remote-sshfs.nvim at v0.2.0 – Mozilla Firefox", "initialClass": "firefox", "initialTitle": "Mozilla Firefox", "pid": 48062, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": ["0x5e4418534280", "0x5e44184d0890", "0x5e4418544440", "0x5e4418535f50"], "swallowing": "0x0", "focusHistoryID": 9 },{ "address": "0x5e44183639e0", "mapped": true, "hidden": false, "at": [3200, -876], "size": [1280, 720], "workspace": { "id": -90, "name": "special:scratch_confluence" }, "floating": true, "monitor": 1, "class": "chrome-censored__-Default", "title": "Übersicht - Confluence", "initialClass": "chrome-censored__-Default", "initialTitle": "censored_/", "pid": 19469, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 19 },{ "address": "0x5e4418416840", "mapped": true, "hidden": false, "at": [409, -1457], "size": [1742, 1167], "workspace": { "id": -89, "name": "special:scratch_pps" }, "floating": true, "monitor": 2, "class": "chrome-censored-Default", "title": "censored", "initialClass": "censored__-Default", "initialTitle": "censored/", "pid": 20509, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 15 },{ "address": "0x5e441891aa60", "mapped": true, "hidden": false, "at": [2560, 0], "size": [2560, 1440], "workspace": { "id": 5, "name": "5" }, "floating": false, "monitor": 1, "class": "org.remmina.Remmina", "title": "censored", "initialClass": "org.remmina.Remmina", "initialTitle": "censored", "pid": 854971, "xwayland": false, "pinned": false, "fullscreen": true, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 5 },{ "address": "0x5e44182cd3d0", "mapped": true, "hidden": false, "at": [2816, -1437], "size": [2048, 1152], "workspace": { "id": -88, "name": "special:scratch_rittersms" }, "floating": true, "monitor": 1, "class": "censored_-Default", "title": "censored", "initialClass": "chrome-censored__-Default", "initialTitle": "censored", "pid": 753113, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 14 },{ "address": "0x5e44189b0110", "mapped": true, "hidden": false, "at": [10, 43], "size": [2540, 690], "workspace": { "id": 4, "name": "4" }, "floating": false, "monitor": 2, "class": "kitty", "title": "~", "initialClass": "kitty", "initialTitle": "zsh", "pid": 2785774, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 2 },{ "address": "0x5e4418929a20", "mapped": true, "hidden": false, "at": [1284, 741], "size": [1266, 689], "workspace": { "id": 4, "name": "4" }, "floating": false, "monitor": 2, "class": "kitty", "title": "hyprctl clients -j", "initialClass": "kitty", "initialTitle": "zsh", "pid": 2783556, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 0 },{ "address": "0x5e441892b010", "mapped": true, "hidden": false, "at": [10, 741], "size": [1266, 343], "workspace": { "id": 4, "name": "4" }, "floating": false, "monitor": 2, "class": "kitty", "title": "~", "initialClass": "kitty", "initialTitle": "zsh", "pid": 2783566, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 1 },{ "address": "0x5e4418942c90", "mapped": true, "hidden": false, "at": [10, 1092], "size": [1266, 338], "workspace": { "id": 4, "name": "4" }, "floating": false, "monitor": 2, "class": "kitty", "title": "~", "initialClass": "kitty", "initialTitle": "zsh", "pid": 2783786, "xwayland": false, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": 6 },{ "address": "0x5e4418971cd0", "mapped": false, "hidden": false, "at": [0, 0], "size": [0, 0], "workspace": { "id": -1, "name": "" }, "floating": false, "monitor": -1, "class": "", "title": "", "initialClass": "", "initialTitle": "", "pid": -1, "xwayland": true, "pinned": false, "fullscreen": false, "fullscreenMode": 0, "fakeFullscreen": false, "grouped": [], "swallowing": "0x0", "focusHistoryID": -1 }]

[{ "id": 0, "name": "eDP-1", "description": "BOE 0x0A67 (eDP-1)", "make": "BOE", "model": "0x0A67", "serial": "", "width": 2560, "height": 1440, "refreshRate": 240.00000, "x": 5120, "y": 5, "activeWorkspace": { "id": 3, "name": "3" }, "specialWorkspace": { "id": 0, "name": "" }, "reserved": [0, 33, 0, 0], "scale": 1.60, "transform": 0, "focused": false, "dpmsStatus": true, "vrr": false, "activelyTearing": false },{ "id": 1, "name": "DP-4", "description": "Samsung Electric Company LU28R55 H4ZMA00326 (DP-4)", "make": "Samsung Electric Company", "model": "LU28R55", "serial": "H4ZMA00326", "width": 3840, "height": 2160, "refreshRate": 59.99900, "x": 2560, "y": 0, "activeWorkspace": { "id": 2, "name": "2" }, "specialWorkspace": { "id": 0, "name": "" }, "reserved": [0, 33, 0, 0], "scale": 1.50, "transform": 0, "focused": false, "dpmsStatus": true, "vrr": false, "activelyTearing": false },{ "id": 2, "name": "DP-5", "description": "Samsung Electric Company LU28R55 H4ZMA00357 (DP-5)", "make": "Samsung Electric Company", "model": "LU28R55", "serial": "H4ZMA00357", "width": 3840, "height": 2160, "refreshRate": 60.00000, "x": 0, "y": 0, "activeWorkspace": { "id": 4, "name": "4" }, "specialWorkspace": { "id": 0, "name": "" }, "reserved": [0, 33, 0, 0], "scale": 1.50, "transform": 0, "focused": true, "dpmsStatus": true, "vrr": false, "activelyTearing": false }]

Yes, the behavior is transferred to the next windows, if I switch with the arrow keys.

All my monitors have a scaled resolution.
Thank you!

@fdev31
Copy link
Collaborator

fdev31 commented Mar 1, 2024

So I confirm this is because of the scale, it's not handled at the moment, it will probably be fixed quickly (today?).

@fdev31 fdev31 closed this as completed in c06a7ff Mar 1, 2024
@nsyring
Copy link
Author

nsyring commented Mar 2, 2024

this is great! I will check it out. Thanks

@nsyring
Copy link
Author

nsyring commented Mar 7, 2024

Thank you again for fixing this.
But is it intentional, that the windows to center will be positioned at the middle of the hole screen-space? In my case about 2/3 of the center monitor. I expected that the layout_center will position the window at the center of a workspace. But maybe I was wrong.
Cheers

@fdev31
Copy link
Collaborator

fdev31 commented Mar 16, 2024

You are welcome! but I'm not fully understanding this feedback, isn't the actual window centered ?
Is it "too big" ? or something maybe I'm not knowing where you use several workspaces on a single screen ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants