-
Notifications
You must be signed in to change notification settings - Fork 30
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
100% width not operating as expected with vertical monitors #11
Comments
Ah yep thanks, fixed in d3bf3b0 - It was just using the unrotated width / height for calculating percentages. |
That's strange - could you recompile with debugging enabled, and paste the terminal output of tofi here? Debugging's the default state, so it should just be: git clone https://github.com/philj56/tofi.git # Or download the tarball
cd tofi/
meson build
ninja -C build
ln -s tofi ./build/tofi-run # Have to do this if you're not installing
./build/tofi-run |
Sure! Debug outputs:
|
Ok, so the important lines are the
That's a little suspicious to me, 1280 is the default width of the window if you don't pass any width options. Are you sure you have
or pass it explicitly with
|
Hmmmm, maybe I broke something when I changed the percentage handling - could you try it with the last commit before I changed that (c9f1dae)?
If that doesn't work, what OS / sway version ( |
I did it but didn't work. I use Devuan Ceres (unstable) and Sway 1.7. |
Thanks, I guess I'll give it a go on Devuan myself then and see if I can replicate it. One last thing, if you're comfortable doing a little source-code hacking, could you stick in some print statements at log_debug("Output size: %u x %u.\n", el->width, el->height);
log_debug("Desired window size: %u x %u\n", tofi.window.width, tofi.window.height);
log_debug("Percentage?: %d, %d\n", tofi.window.width_is_percent, tofi.window.height_is_percent); (or in diff format): diff --git a/src/main.c b/src/main.c
index 8cc913d..9fe5162 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1137,6 +1137,9 @@ int main(int argc, char *argv[])
tofi.window.scale = el->scale;
tofi.window.transform = el->transform;
log_debug("Selected output %s.\n", el->name);
+ log_debug("Output size: %u x %u.\n", el->width, el->height);
+ log_debug("Desired window size: %u x %u\n", tofi.window.width, tofi.window.height);
+ log_debug("Percentage?: %d, %d\n", tofi.window.width_is_percent, tofi.window.height_is_percent);
}
/* We can now calculate any percentages, as we know the output size. */ And see what the debug output shows then? I'm trying to work out where the wrong value is coming from. |
Hi, I hacked and recompiled... Logs you requested:
What does the desired window size mean? |
Thanks for doing all this, it's very helpful! That's really odd though. The desired window size means the size tofi's going make a buffer for and ask the window manager to display. Here it's working as expected - it's 100% x 20px. The The very last thing I can think of (apparently I lied before) is to print something else, at line 514 in diff --git a/src/main.c b/src/main.c
index 8cc913d..93d175e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -512,6 +512,7 @@ static void output_mode(
{
struct tofi *tofi = data;
struct output_list_element *el;
+ log_debug("Output %p, Mode %d x %d, current? %d\n", wl_output, width, height, flags & WL_OUTPUT_MODE_CURRENT);
wl_list_for_each(el, &tofi->output_list, link) {
if (el->wl_output == wl_output) {
if (flags & WL_OUTPUT_MODE_CURRENT) { If that's reporting 1280 x 800 as the only current resolution, I'm fairly sure this is a bug in Sway / wlroots. |
You're welcome. I have an idea. I think it might have something to do with the Sway scale value. I am using the scale
|
Ahhhh, that'd do it. There's no way (that I'm aware of) for an application to be aware of a fractional scale factor directly - all of the Wayland protocols (such as As a workaround, you can pass I'll close this issue and open a new one with this info for anyone else who runs into it. |
Thanks for everything. Good luck! |
I use a mix of vertical and horizontal monitors, when I open it on my horizontal monitor tofi spans across my entire screen
But when I open it on my vertical monitor, it seems to keep using the same width as the horizontal monitor
Without seeing the code if I had to guess, width 100% is probably being based off of the main monitor width
The text was updated successfully, but these errors were encountered: