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

Tilda does not resize properly after fullscreen mode #306

Closed
madeindjs opened this issue Sep 4, 2017 · 19 comments
Closed

Tilda does not resize properly after fullscreen mode #306

madeindjs opened this issue Sep 4, 2017 · 19 comments

Comments

@madeindjs
Copy link

I have theses settings for windows size

  • width: 100% (or 1920 px)
  • height: 50 % (or 529 px)

This is actually 100% / 50%.

When enter in fullscreen mode F11, hide Tilda F1 and then I unhide Tilda F1 my configuration change.

Windows size is now 1920px / 529px.

I had to change my configuration mannyally after theses steps.

My OS: Linux Mint 18.2 Sonya / Tilda 1.3.1.

@lanoxx
Copy link
Owner

lanoxx commented Oct 24, 2017

Could you check if the patch in the branch wip/fullscreen (e.g. commit 84fe390) fixes the issue?

@webmatze
Copy link

I just tried the branch wip/fullscreen on Ubuntu 17.10.

I did the following steps:

  1. enter fullscreen mode F11
  2. hide Tilda F1
  3. unhide F1
  4. then leave fullcreen mode F11

Now Tilda is still nearly full screen. But after I hide Tilda again F1 and then show it F1 it is at its old size but not at the right position. If I press F1 two times more it is back at its configured position (centered vertically and horizontally)

So there is still a problem here.

@voidplayer
Copy link

I just tested this on last 1.4.1-1 and still happens :(

Does the patch still need testing?

@lanoxx
Copy link
Owner

lanoxx commented Feb 18, 2018

@voidplayer First, if the patch in wip/fullscreen does not cause and negative side effects I can merge it into master and also backport to the 1.4.x series.

Regarding the issue reported by @webmatze. I can confirm that there is still a problem, however I cannot see that there is any code in Tilda that would be causing this behavior. My best guess is that either GTK+ or the Window Manager has a bug that causes this behavior. There is already code in place when returning from fullscreen mode to restore the original window size:

https://github.com/lanoxx/tilda/blob/master/src/tilda_window.c#L177

For some reason that seems to have no effect in certain situations.

@voidplayer
Copy link

Are you able to reproduce it? I mean, thats the most important thing to find the real cause :)

I just tried the patch and it doesnt fix it for me :(

After f11->hidding->showing, it never gets to the original size unless I do two things:

  • Drag the window with alt + mouse out of the full screen position. This get the window out of the "full screen" state. It switches to a smaller window but not the original settings
  • Enter configuration/aparence/width and modify some of the values. Then it gets to original size

Not sure if this is what you are able to reproduce or different. I dont know much about gtk, but tell me if I can be of any more help :)

@voidplayer
Copy link

Btw, I just want to add a workaround in case somebody else find it useful :)

I have an 'extra' tilda config with a different key for full screen where tilda takes up all the screen

I try to spawn the processes that will eventually need more room on this tilda instead of the regular ones. Ex. Programming consoles, diffs, big debugging outputs

Not perfect or as confy as using your regular tildas because you have to think ahead but it works pretty well

@lanoxx
Copy link
Owner

lanoxx commented Feb 19, 2018

Yes I can reproduce the problem, but I do not know how to fix it. To me it seems like a problem in GTK+.

@voidplayer
Copy link

Thanks for your time

Whats the exact api call that is not behaving as expected?

I will open a bug in gtk

@lanoxx
Copy link
Owner

lanoxx commented Feb 19, 2018

@voidplayer I you look at the code for returning from fullscreen you see the following functions get called:

gtk_window_unfullscreen (GTK_WINDOW (tw->window));
// This appears to be necssary on (at least) xfwm4 if you tabbed out
// while fullscreened.
gtk_window_set_default_size (GTK_WINDOW(tw->window), config_getint ("max_width"), config_getint ("max_height"));
gtk_window_resize (GTK_WINDOW(tw->window), config_getint ("max_width"), config_getint ("max_height"));

gtk_window_move(GTK_WINDOW(tw->window), config_getint ("x_pos"), config_getint ("y_pos"));

The first calls GTK to disable fullscreen mode, the next three calls ensure that the window restores its proper size and position. In an ideal scenario I would assume that the window size and position is cached somewhere (e.g. in the X11 window object, GTK, etc.) and that this information is used to restore the size after returning from fullscreen. The fact that returning from fullscreen works most of the time shows that something is being cached somewhere. It seems that hiding tilda and restoring it, while it is in fullscreen mode somehow clears or changes this cached information and thus prevents the window from returning to its original size.

For example, even if I remove the last three lines and toggle fullscreen mode the window size and position is correctly restored after returning from fullscreen (as long as I do not hide the window in between).
If I do hide and show the tilda window with fullscreen enabled and while those last three lines are commented out, then not only does the tilda size change, but its now also located at the center of the screen.

In summary, to find the source of this bug I believe that gtk_window_unfullscreen would be a good starting point to find this bug. However, the GTK documentation also clearly states that the behavior of this function is window manager dependent. Therefore it may also be the case that this bug is not actually a GTK bug, but that the problem lies even further down the stack, possibly in the window manager.

While writing this a took a look if metacity prints anything while this bug occurs and I noticed the following output:

Window manager warning: Treating resize request of legacy application 0x1600007 (tilda) as a fullscreen request

@lanoxx
Copy link
Owner

lanoxx commented Feb 19, 2018

I think I can propose a workaround for this bug. If we temporarily unfullscreen the tilda window before hiding it, then it seems that the bug does not occur.

@lanoxx lanoxx closed this as completed in 4c25213 Feb 19, 2018
@lanoxx
Copy link
Owner

lanoxx commented Feb 19, 2018

Please reopen if this does not fix the problem.

@voidplayer
Copy link

Well, this workaround indeed fixed the issue for me

Thank you so much!

@Gerrit-K
Copy link

Gerrit-K commented Jul 4, 2018

Is there any way to code this 'workaround' into the application? (or fix the bug of course ...)
Edit: nevermind, didn't see the linked commit

@lanoxx
Copy link
Owner

lanoxx commented Jul 4, 2018

This workaround is already part of tilda, but is currently not available in any of tilda's released versions. You can try to compile tilda from the master branch or wait until a new tilda release is available.

@Gerrit-K
Copy link

Gerrit-K commented Jul 4, 2018

Wow, kudos for the quick reply. Thanks, looking forward to the next update. Loving Tilda so far!

@makemegit
Copy link

makemegit commented Jul 17, 2018

I have the same issue on Ubuntu Mate 18.04 fresh install. The only workaround i have found is to right click and select "Toggle Fullscreen" two times. This is very strange. It seems like F11 and "Toggle Fullscreen" options are not the same things. I hope someone resolve that issue.

@falsechicken
Copy link

@makemegit Thanks! I have been having this issue for like a year! (Ubuntu 18.04.1)

@Gratouille
Copy link

It seems I've always this problem under Ubuntu 18.04.2. The @makemegit's workaround indeed works but it's like a no-solution for me, I would like to not use my mouse to solve something made for the keyboard :(

I've seen the @lanoxx reply, is a new version fixing this is going out anyday ?

Thx a lot, loving Tilda over any other terms for now, that's the only pb I've with :(

@voidplayer
Copy link

voidplayer commented Feb 28, 2019

Theres no new version with this fix afaik

I have compiled the latest version with this fix and is the one i use :)

Thats the only way to get it until a new release is done at the discretion of lanoxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants