This would be a nice addition to Mousepad. Of course one can use the fullscreen-mode of xfwm4, but it's not the same (the menubar remains visible). Check out gedit's fullscreen-mode (or ristretto's ftm), touching the top-border of the screen with the mouse reveals a toolbar.
Created attachment 5218 Preliminary patch I have prepared this patch taking as reference Ristretto code. But there are some problems that I can't solve(I'm no GTK expert): -The toolbar doesn't hide automatically, because notebook can't receive enter-notify-events(I guess). -The fullscreen button in toolbar takes about 2 seconds to appear at first time. -The toolbar separator doesn't expand. -The code related to add the toolbar to the window(around line 670) causes some errors in mousepad_window_connect_proxy(check console).
Hey, thanks a lot – that's a very good starting point! (I can confirm the issues you listed though, but those seem manageable.) Actually it might be helpful to have some items in that toolbar (e.g. open-document, save-document, etc.), what do you think?
(In reply to Simon Steinbeiss from comment #2) > Actually it might be helpful to have some items in that toolbar (e.g. > open-document, save-document, etc.), what do you think? Indeed. I think basic actions like new file, open, save, undo/redo and maybe copy/cut/paste should be fine.
Indeed, sounds good!
I forgot to ask: will you try to improve the patch? If you're too busy, please give hints to solve problems I mentioned.
(In reply to André Miranda from comment #5) > I forgot to ask: will you try to improve the patch? If you're too busy, > please give hints to solve problems I mentioned. Ok, just to clarify in advance, neither am I mousepad's developer or maintainer, nor am I really a coder. We implemented the fullscreen-mode a bit differently in Parole, and I'm not familiar enough with Ristretto's code to be able to provide real guidance here.
I added regular fullscreen support (ie. using gtk_window_fullscreen()) in http://git.xfce.org/apps/mousepad/commit/?id=a3a9517357d28aa6a7701fd600b5cfc327076ecb and a toolbar in http://git.xfce.org/apps/mousepad/commit/?id=2b5155971e93df04e85419fd56966eb01f15971a. I bet the rest of this bug (hiding the menubar and making the toolbar auto-hide) won't be so big/tricky now.
Nice job Matt! While testing, I noticed that the toolbar is not shown/hidden correctly: 1. Open mousepad 2. Go to fullscreen mode (F11) 3. Enable the toolbar (View->Toolbar) 4. Leave fullscreen mode (F11) Notice that the toolbar is still displayed 5. Go to fulllscreen mode again The toolbar is not being displayed. 6. Leave fullscreen mode The toolbar is being displayed even though View->Toolbar is unchecked.
Created attachment 8588 patch The attached patch should fix this problem. It is caused by querying the window status before fully entering or leaving fullscreen mode. Therefore, bar visibility is restored for the opposite mode.
Created attachment 8590 Fix return type of fullscreen settings
Created attachment 8596 patch v2 Slightly tweaked version of the patch.
The 2nd patch looks nicer code-wise, but I'm not a big fan of magic numbers (200ms in first patch, 50ms in second). It seems like it might depend on the windowing server, graphics card, CPU speed, etc.
I changed the priority to G_PRIORITY_DEFAULT_IDLE also. This and a delay of 50ms seem to work fine when testing with a slow VM.
It might be interesting to see how other programs are dealing with this.
(In reply to Andre Miranda from comment #8) > Nice job Matt! > > While testing, I noticed that the toolbar is not shown/hidden correctly: > 1. Open mousepad > 2. Go to fullscreen mode (F11) > 3. Enable the toolbar (View->Toolbar) > 4. Leave fullscreen mode (F11) > Notice that the toolbar is still displayed > > 5. Go to fulllscreen mode again > The toolbar is not being displayed. > > 6. Leave fullscreen mode > The toolbar is being displayed even though View->Toolbar is unchecked. Tested the patch v2 in comment #11 and it fixes the issue in the steps above. Everything seems to be in sync with what is displayed.
Theo Linkspfeifer referenced this bugreport in commit bba524f4132b5535189d4114faa7916ea9817084 Fix return type of fullscreen settings (Bug #9735) https://git.xfce.org/apps/mousepad/commit?id=bba524f4132b5535189d4114faa7916ea9817084
Theo Linkspfeifer referenced this bugreport in commit 0df544c677a66f47713381190ff8f098e8f63fa1 Change visibility of fullscreen bars after small delay (Bug #9735) https://git.xfce.org/apps/mousepad/commit?id=0df544c677a66f47713381190ff8f098e8f63fa1
Second patch pushed to master, if this causes problems we can always revert.