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

Foot terminal incorrect size for a brief moment on startup #4022

Closed
ErrorNoInternet opened this issue Dec 2, 2023 · 21 comments
Closed

Foot terminal incorrect size for a brief moment on startup #4022

ErrorNoInternet opened this issue Dec 2, 2023 · 21 comments
Labels
bug Something isn't working stale Not much going on

Comments

@ErrorNoInternet
Copy link
Contributor

Hyprland Version

main branch commit e2f18f8

Bug or Regression?

Bug

Description

The foot terminal briefly opens with a much smaller size.

Creator says it's not a foot issue.

https://codeberg.org/dnkl/foot/issues/1211
https://codeberg.org/dnkl/foot/issues/1133
swaywm/sway#2176

How to reproduce

  1. Open foot (v1.16.2) with animations

Crash reports, logs, images, videos

recording.webm
@ErrorNoInternet ErrorNoInternet added the bug Something isn't working label Dec 2, 2023
@vaxerski
Copy link
Member

vaxerski commented Dec 2, 2023

we can't really "predict" the size on map the window should become reliably with the current codebase, but we could just set it to the monitor's res and adjust when it is mapped

@bvr-yr
Copy link
Contributor

bvr-yr commented Dec 5, 2023

i'm using a little workaround:

add initial-window-size-pixels=2000x2000 to foot.ini, or just ur monitor size

to avoid problems when launching with [float] exec-rule, u can add

windowrulev2 = size 1016 648,class:^(foot)$,floating:true
windowrulev2 = center 1,class:^(foot)$,floating:true

to ur hyprland.conf
and use a wrapper script for togglefloating bind:

#!/usr/bin/bash

dump=$(hyprctl activewindow -j | jq -r '.initialClass+" "+(.floating|tostring)')
read -r class float <<< "$dump"

if ! $float && [[ $class == foot ]]; then
	hyprctl --batch \
		"dispatch togglefloating active; \
		dispatch resizeactive exact 1016 648; \
		dispatch centerwindow"
else
	hyprctl dispatch togglefloating
fi &>/dev/null

adjust sizing at your taste

@gmr458
Copy link

gmr458 commented Dec 15, 2023

I have this same problem, but only with Foot and Alacritty.

Kitty, Wezterm and GNOME terminal do not have this problem.

Kooha-2023-12-14-18-22-44.mp4

I can't say how long ago or give an exact version of when this happened, but I'm pretty sure this didn't happen before, both in Alacritty and Foot.

@vaxerski
Copy link
Member

yes, it would be stretched to fill instead, looking wonky and technically being non-protocol-compliant

@bvr-yr
Copy link
Contributor

bvr-yr commented Dec 15, 2023

btw problem disappeared with foot for me, although i can't tell what commit exactly had affected it, i just accidently noticed when launched foot without wrapper-script and no config

@ErrorNoInternet
Copy link
Contributor Author

ErrorNoInternet commented Dec 15, 2023

Still happening for me on Hyprland 62a8d0b and foot 1.16.2
Gonna re-test with the latest commit soon

@gmr458
Copy link

gmr458 commented Dec 15, 2023

@bvr-yr Which version of Foot and Hyprland are you using?

@bvr-yr
Copy link
Contributor

bvr-yr commented Dec 15, 2023

foot 1.16.2-2 @ arch
hyprland-git 36fa33f

no foot updates since i saw those glitches, so it should be some hyprland commit

@bvr-yr
Copy link
Contributor

bvr-yr commented Dec 15, 2023

actually it is barely seen on recording, but it's due to encoding settings my recorder uses, nothing seen in real world

test-foot5.mp4

default hyprland.conf and foot without foot.ini

@ErrorNoInternet
Copy link
Contributor Author

ErrorNoInternet commented Dec 16, 2023

Still happening for me on b1b8d73 (with default foot config)

@vaxerski
Copy link
Member

guys I'd like you to please stop commenting it's happening. I do realize. You just spam my inbox.

This will not be fixed anytime soon. For foot, a workaround that works on both sway and hyprland has been posted and it's to make the initial size bigger in foot's cfg.

vaxerski added a commit that referenced this issue Dec 17, 2023
Should improve #4022 although not exactly fix. Fixing would require more witchcraft
@vaxerski
Copy link
Member

above commit should improve things

@bvr-yr
Copy link
Contributor

bvr-yr commented Dec 18, 2023

well, after 763d5fa windowzise-related options in foot.ini are completely ignored, which is sad, cause there is window-size-chars option to get pixel-perfect size depending on your font, which is very useful when using different fontsizes for multiple monitors with different dpi

Now it just stretches to monitor size when started with hyprctl dispatch exec "[float]foot" or just with float windowrule in config, or after togglefloat. Seems like a time to make another bunch of windowrules 🤣

@fufexan
Copy link
Member

fufexan commented Dec 18, 2023

FYI 763d5fa breaks wezterm. It says it's started but does not appear, and hyprctl clients lists only broken clients:

{
  "address": "0x3950050",
  "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": false,
  "pinned": false,
  "fullscreen": false,
  "fullscreenMode": 0,
  "fakeFullscreen": false,
  "grouped": [],
  "swallowing": "0x0",
  "focusHistoryID": -1
}

@vaxerski vaxerski added the stale Not much going on label Feb 16, 2024
@bvr-yr
Copy link
Contributor

bvr-yr commented Feb 28, 2024

what about this? #4022 (comment)
windowrules are only waytogo now?

@vaxerski
Copy link
Member

there is an issue open for that iirc

@bvr-yr
Copy link
Contributor

bvr-yr commented Feb 28, 2024

oopsie, i see.
and it actually not totally gone. i can see black rectangle again, but seems only when launching floating above existing window

@vaxerski
Copy link
Member

yes a bug for that is open

@vaxerski
Copy link
Member

#4871

@ErrorNoInternet
Copy link
Contributor Author

I wonder if its possible to account for gaps and window borders? Some terminal applications (e.g. nvtop) will open with a slightly larger size on startup, causing them to flash and resize again a bit later (since the terminal just became smaller by like 3-4 columns) (prediction is bigger than the window size because of borders and gaps)

It also happens with my terminal prompt which has items on the right side. I get small visual artifacts on startup because the prompt is resizing itself again

@vaxerski
Copy link
Member

vaxerski commented Mar 8, 2024

it is possible, but I am too lazy. Feel free to MR.

lisuke pushed a commit to lisuke/Hyprland that referenced this issue Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Not much going on
Projects
None yet
Development

No branches or pull requests

5 participants