Peek: Peek Window is really thin, making it very hard to resize

Created on 23 Oct 2017  ·  59Comments  ·  Source: phw/peek

I'm not sure fi this is a good question for Github, but I've noticed the Window is very very thin, making it a pain in the ass to try to resize, the thingie is also completely transparent.

https://i.imgur.com/GoITz3b.png

How do I fix this? This wasnt the issue when I installed Peek on my last Ubuntu install.

bug upstream

Most helpful comment

I made a screen capture of Peek (using Peek :smile: ) to demonstrate the following statement:

It seems that:

  • I can resize the window using the top of the window, as there is the title bar.
  • I can resize the window using the left border if I am really careful (I suppose it is a 1px hitbox).
  • I can not resize the window at all using the bottom nor the right border of the window.

peek 18-11-2017 10-31

All 59 comments

Is this the default Ubuntu theme? Which version of Ubuntu is this on? Maybe I have to tweak the styling for this particular theme a bit.

Changed to defualt theme. Gnome. https://i.imgur.com/PmEZR1r.png

This is how it looks like with. Still way too thin but at least it's not transparent anymore.

Actually it is so thin by purpose, but with the Adwaita theme or Arc (which I use) it is not a big deal, since the area to grab for resizing is larger then just the thin border (you can grab slightly outside the border).

I have to test, maybe you could even click slightly inside the border, but this is prevented by the click through of Peek. If so I might make the click-through area 2 or 3 pixel smaller to allow for easier resizing.

Okay. Thank you for your time.

Hello!

I just installed Peek and encountered the same issue on KDE (Plasma 5.5.5).
It is nearly impossible to resize the window.

Besides that, Peek seems really nice! Thank you.

Please tell me if I can help you or if you need more details about the issue.

Please tell me if I can help you or if you need more details about the issue.

I will take a look. What GTK theme is this then?

What GTK theme is this then?

I am not famliar with desktop themes so I am not sure I use a GTK theme since I run KDE.

The KDE theme is Breeze (I suppose it corresponds to this project), this is one of the official (pre-installed) themes as far as I know.
In the KDE settings there is an option to choose GTK themes, maybe this is what is used for GTK applications? If that is so, The GTK theme is also Breeze, presumably this.

Does this answer your question?

For your information, here is how Peek looks on my machine:
screenshot576

I can confirm this in ubuntu 16.04 with gnome desktop. Basically impossible to resize, but double-clicking the title bar does maximize it.

I cannot really reproduce this. This is how Peek looks with the default Ubuntu Ambiance theme on Ubuntu 17.10 GNOME:

bildschirmfoto vom 2017-11-08 00-05-10

You can drag the border easily, as the entire shadow area around the window is draggable.

Same on 16.04 Unity:

bildschirmfoto vom 2017-11-08 00-10-59

Haven't tested that KDE theme yet.

Now I also tried the Breeze theme. It maybe looks thinner, but behaves exactly the same. Just to make this clear: In the screenshots above I have easily an area of 10-14 pixels around the edge where I can drag. Isn't that the case for you?

Also I can make the visible border around the inner recording area thicker, but that has no influence on the area that is available for resizing. Peek just provides as much space for resizing as every other window I tried to open.

@davidv171 The only screenshot here that looks of is https://i.imgur.com/GoITz3b.png from your original report. This is also Ambiance, right? What desktop environment is it?

@phw yes it was ambiance.

Since I cant edit on mobile its gnome(think I mentioned that somewhere)

Can I use peek to record peek itself? (Probably not)

Hello @phw,

Thank you for considering the issue.

Now I also tried the Breeze theme. It maybe looks thinner, but behaves exactly the same. Just to make this clear: In the screenshots above I have easily an area of 10-14 pixels around the edge where I can drag. Isn't that the case for you?

No, not for me.

It seems that:

  • I can resize the window using the top of the window, as there is the title bar.
  • I can resize the window using the left border if I am really careful (I suppose it is a 1px hitbox).
  • I can not resize the window at all using the bottom nor the right border of the window.

Also I can make the visible border around the inner recording area thicker, but that has no influence on the area that is available for resizing. Peek just provides as much space for resizing as every other window I tried to open.

This is not the case on KDE : the issue I described does not apply to windows of other applications such as Firefox, Konsole, KeePassXC…

Just an update: In order to reproduce this I tried installing KDE Plasma in my Ubuntu 16.04 VM. Unfortunately Plasma is completely unusable and broken there (most windows are undecorated and full of graphical glitches) and I can't really test with this. Maybe I should install a newer Kubuntu instead or run on real hardware via live CD.

@phw If you want a decent dedicated linux laptop, the Dell XPS 13 with ubuntu 16.04 preinstalled is pretty good. Something like $1500 cheaper than a Mac too.

I cloned the repo and tried to tweak some properties in the application-window.ui file without success. I tried to set a border width; it displayed a border but it was not related to the ability to grab the window for resize.

Then I made a bit of research on the subject and found nothing. It was difficult since I do not know anything about GTK or desktop application UI in general, so maybe I did not search with proper keywords.

In the end I found a workaround using the KDE settings: I configured a KWin keyboard shortcut to resize the current window. I still can not grab the window's edges to resize it, but I can trigger a resize using a custom keyboard shortcut.

I made a screen capture of Peek (using Peek :smile: ) to demonstrate the following statement:

It seems that:

  • I can resize the window using the top of the window, as there is the title bar.
  • I can resize the window using the left border if I am really careful (I suppose it is a 1px hitbox).
  • I can not resize the window at all using the bottom nor the right border of the window.

peek 18-11-2017 10-31

I installed KDE Neon in a VM to test this, and yes, I can easily reproduce it. Unfortunately this seems to be an issue with KWin having issues with GTK3 client side decorations (CSD). For some reason the drop shadow is not rendered (which in case of CSD windows GTK3 would need to do). I don't know whether this is a defect in GTK3 or KWin. I could also reproduce the very same annoying issue with GNOME Todo and GNOME calculator.

There are two workarounds:

  1. Change the GTK3 theme
    In Settings > Application Style > GNOME Application Style set the GTK3 theme to "default". Now Peek will have a larger draggable border, but GTK applications will look a bit out of place and less integrated.

  2. Set theme and window manager overrides for Peek
    Basically do what is described in https://www.reddit.com/r/kde/comments/563snw/no_shadows_around_some_windows_in_kde_57/ for Peek.

    In [ System settings ] -> [ Window management ] -> [ Window rules ] -> [ Appearance & Fixes ] , set [ No titlebar and frame] to No
    In [ System settings ] -> [ Application Style ] -> [ Window decoration ] -> [ Breeze theme setting ] -> [ Window specific overrides ], Set [ border size ] to Normal and set [ Hide Window title bar ] to yes.

    The last step differs a bit from the linked description. The border size should be set to Normal or Tiny, but not No border. With No border you would get an ugly resize triangle in the lower right border, which also is visible in recordings. Still this looks a bit odd, as there will be an extra frame around the Peek window, but it makes it usable.

Next step is trying to figure out if I can do anything in the theming to make it work a bit better on KWin with Breeze. After all the default GTK3 theme Adwaita seems to have a workaround for it.

Related discussion and bug: https://bugzilla.gnome.org/show_bug.cgi?id=729721

The status quo is that GTK does not draw the shadow, as it causes issues with KWin. Not sure exactly what the issues are, but presumably it has to do with size calculations, as the shadows are outside the window and should not be taken by the WM as the outer border of the entire window.

I made some changes to the theme to allow for a larger resize border on Plasma if the Breeze theme is used:

bildschirmfoto vom 2017-11-19 01-27-17

Could you try the latest development release to see if this fixes your issue? Daily PPA builds and Snap package on edge are currently building and should provide the latest code soon.

Hello,

Thank you for trying this!

I built Peek from sources (on master).
Unfortunately, this does not seem to do the trick on my setup:
peek 2017-11-19 09-20

But if the issue is caused by GTK or KWin, maybe you should not change anything in Peek?
As far as I am concerned, I can deal with it thanks to the workaround described earlier in the thread, and we do not even know if this issue concerns a lot of setups.

@cGuille I guess the theme detection is not working as it should. Currently I have to detect whether KDE is running to get th
KDE's theme config. Could you give me the output of env on your system. Especially the values of XDG_SESSION_DESKTOP, DESKTOP_SESSION and XDG_CURRENT_DESKTOP.

Basically all KDE users using the default theme are affected. I think given the general disagreement between the KWin and GTK teams regarding CSD it is unlikely we will get a proper solution from upstream, so a workaround sounds like a good idea.

Here it is:

$ env | grep -E '(XDG_SESSION_DESKTOP|DESKTOP_SESSION|XDG_CURRENT_DESKTOP)'
DESKTOP_SESSION=/usr/share/xsessions/plasma
XDG_SESSION_DESKTOP=KDE
XDG_CURRENT_DESKTOP=KDE

@cGuille Ok, that should work. What is the contents of $HOME/.config/gtk-3.0/settings.ini? Can you also start Peek (latest source again) with

G_MESSAGES_DEBUG=all peek

That should output the detected GTK theme.

$ cat $HOME/.config/gtk-3.0/settings.ini
[Settings]
gtk-font-name=Noto Sans Regular 10
gtk-theme-name=Breeze
gtk-icon-theme-name=breeze
gtk-fallback-icon-theme=Humanity
gtk-toolbar-style=GTK_TOOLBAR_ICONS
gtk-menu-images=1
gtk-button-images=1
$ G_MESSAGES_DEBUG=all ./peek 
(peek:8255): Gtk-DEBUG: Connecting to session manager
** (peek:8255): DEBUG: desktop-integration.vala:168: Desktop: KDE
** (peek:8255): DEBUG: application.vala:286: GTK theme: Breeze
** (peek:8255): DEBUG: desktop-integration.vala:168: Desktop: KDE
** (peek:8255): DEBUG: application.vala:341: Decoration layout: menu:minimize,maximize,close
** (peek:8255): DEBUG: desktop-integration.vala:168: Desktop: KDE
** (peek:8255): DEBUG: desktop-integration.vala:168: Desktop: KDE
** (peek:8255): DEBUG: utils.vala:68: Looking for executable ffmpeg (0): /usr/bin/ffmpeg

Using screen recorder backend ffmpeg
** (peek:8255): DEBUG: application-window.vala:793: Decoration layout: menu:minimize,maximize,close
** (peek:8255): DEBUG: recording-area.vala:38: Absolute recording area x: 410, y: 239, w: 759, h: 431
** (peek:8255): DEBUG: recording-area.vala:45: Screen w: 1600, h: 900
** (peek:8255): DEBUG: recording-area.vala:58: Clipped recording area x: 410, y: 239, w: 759, h: 431
** (peek:8255): DEBUG: recording-area.vala:69: Scaled recording area x: 410, y: 239, w: 759, h: 431
** (peek:8255): DEBUG: recording-area.vala:38: Absolute recording area x: 410, y: 239, w: 759, h: 431
** (peek:8255): DEBUG: recording-area.vala:45: Screen w: 1600, h: 900
** (peek:8255): DEBUG: recording-area.vala:58: Clipped recording area x: 410, y: 239, w: 759, h: 431
** (peek:8255): DEBUG: recording-area.vala:69: Scaled recording area x: 410, y: 239, w: 759, h: 431
** (peek:8255): DEBUG: application-window.vala:204: delete_event: recorder.is_recording=false, window.is_postprocessing=false
** (peek:8255): DEBUG: application.vala:116: Application got shutdown signal

That's actually all looking good :( No idea why this is not working. What KDE version on which distribution is this? I only tested on KDE Neon with latest Plasma.

Edit: Also the GTK version. Could be the required CSS class is missing.

What is MADE and how can I find out its version?

I use Kubuntu 16.04 (upgraded from previous versions).
It runs KDE Plasma 5.5.5 with Qt 5.5.1.

screenshot603

What is MADE and how can I find out its version?

Sorry, I am writing from my mobile and auto correction jumped in, meant KDE. What GTK version is installed?

Does this answer the question? I am not sure.

```
$ dpkg -l libgtk2.0-0 libgtk-3-0
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==========================-==================-==================-==========================================================
ii libgtk-3-0:amd64 3.18.9-1ubuntu3.3 amd64 GTK+ graphical user interface library
ii libgtk2.0-0:amd64 2.24.30-1ubuntu1.1 amd64 GTK+ graphical user interface library
ii libgtk2.0-0:i386 2.24.30-1ubuntu1.1 i386 GTK+ graphical user interface library

Yes, thanks a lot for this info. I will try to figure out what's still going wrong :)

@cGuille I tested on Kubuntu 16.04 with Breeze theme, works for me. I tested on the live CD and installed from daily PPA. Could you also test the daily PPA version:

sudo add-apt-repository ppa:peek-developers/daily
sudo apt update
sudo apt install peek

Nothing changed for me. :s

The update did happen from the daily PPA:

[…]
Réception de:1 http://ppa.launchpad.net/peek-developers/daily/ubuntu xenial/main amd64 peek amd64 1.1.0-1+git788~ppa17~ubuntu16.04.1 [149 kB]
[…]

Here is the installed version:

$ dpkg -l peek
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                              Version               Architecture          Description
+++-=================================-=====================-=====================-========================================================================
ii  peek                              1.1.0-1+git788~ppa17~ amd64                 Simple screen recorder with an easy to use interface

But the issue remains.

That's the latest version. Have you disabled all the KDE settings overrides that I mentioned above as a workaround?

I am going to boot up a Kubutu live cd and do some testing with this.

That's the latest version. Have you disabled all the KDE settings overrides that I mentioned above as a workaround?

Oh no, I thought it was either the workaround or the fix. Sorry.

Oh no, I thought it was either the workaround or the fix. Sorry.

Not sure we understand each other: The fix alone should be enough. The workarounds should not be applied in this case. I don't know what happens if you apply the workarounds, but it could very well interfere with the fix..

So we understood each other until you last question, which I misinterpreted.

No, I did not changed the settings as in your workaround.
I prefer using a keyboard shortcut to resize the window rather than affecting my whole desktop environment.

Would it be possible to draw the transparent overlay which shows the window size up until recording starts? That way we could easily resize with a Alt (or Meta) + Right mouse drag. Then the fix doesn't depend on a specific theme/desktop environment.

I have exactly the same problem, using Antergos and latest KDE on Breeze Theme.

issue_thin_border

cat $HOME/.config/gtk-3.0/settings.ini
[Settings]
gtk-application-prefer-dark-theme=false
gtk-button-images=1
gtk-cursor-theme-name=Breeze_Snow
gtk-fallback-icon-theme=Adwaita
gtk-font-name=ABeeZee Regular 10
gtk-icon-theme-name=breeze
gtk-menu-images=1
gtk-primary-button-warps-slider=0
gtk-theme-name=Breeze
gtk-toolbar-style=GTK_TOOLBAR_ICONS
flood@flood-r3 ~> env G_MESSAGES_DEBUG=all peek
(peek:19161): Gtk-DEBUG: Connecting to session manager
(peek:19161): Gtk-DEBUG: Failed to get the GNOME session proxy: The name org.gnome.SessionManager is not owned
(peek:19161): Gtk-DEBUG: Failed to get the Xfce session proxy: The name org.xfce.SessionManager is not owned
(peek:19161): Gtk-DEBUG: Failed to get an inhibit portal proxy: The name org.freedesktop.portal.Desktop is not owned
** (peek:19161): DEBUG: desktop-integration.vala:168: Desktop: KDE
** (peek:19161): DEBUG: application.vala:286: GTK theme: Breeze
** (peek:19161): DEBUG: desktop-integration.vala:168: Desktop: KDE
** (peek:19161): DEBUG: application.vala:341: Decoration layout: menu:minimize,maximize,close
** (peek:19161): DEBUG: desktop-integration.vala:168: Desktop: KDE
** (peek:19161): DEBUG: application.vala:221: Changed keybinding_toggle_recording  => <Ctrl><Alt>R


** (peek:19161): WARNING **: Binding '<Ctrl><Alt>R' failed!
** (peek:19161): DEBUG: desktop-integration.vala:168: Desktop: KDE
** (peek:19161): DEBUG: utils.vala:68: Looking for executable ffmpeg (0): /usr/bin/ffmpeg

Using screen recorder backend ffmpeg

(peek:19161): Gtk-WARNING **: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(peek:19161): Gtk-WARNING **: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(peek:19161): Gtk-WARNING **: Theme parsing error: gtk.css:71:36: The style property GtkCheckMenuItem:indicator-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(peek:19161): Gtk-WARNING **: Theme parsing error: gtk.css:76:30: The style property GtkExpander:expander-size is deprecated and shouldn't be used anymore. It will be removed in a future version
** (peek:19161): DEBUG: application-window.vala:824: Decoration layout: menu:minimize,maximize,close
** (peek:19161): DEBUG: recording-area.vala:38: Absolute recording area x: 382, y: 315, w: 468, h: 216
** (peek:19161): DEBUG: recording-area.vala:45: Screen w: 1366, h: 768
** (peek:19161): DEBUG: recording-area.vala:58: Clipped recording area x: 382, y: 315, w: 468, h: 216
** (peek:19161): DEBUG: recording-area.vala:69: Scaled recording area x: 382, y: 315, w: 468, h: 216
** (peek:19161): DEBUG: recording-area.vala:38: Absolute recording area x: 382, y: 315, w: 468, h: 216
** (peek:19161): DEBUG: recording-area.vala:45: Screen w: 1366, h: 768
** (peek:19161): DEBUG: recording-area.vala:58: Clipped recording area x: 382, y: 315, w: 468, h: 216
** (peek:19161): DEBUG: recording-area.vala:69: Scaled recording area x: 382, y: 315, w: 468, h: 216

Back at this again. @gandalf3 I like your suggestion, so I have it a quick and dirty try. In the branch https://github.com/phw/peek/tree/easier-window-resizing-on-kde the click-through behavior is disabled while not recording. And then you can easily resize as you said using the mouse (Alt + right click). Currently it is a bit confusing, because the overlay is not shown, so the area is completely transparent. But I will likely clean this up and show the overlay all the time.

Apart from this I am still puzzled why the theme changes are not applied in some cases. For me Peek works very much like any native KDE application regarding the resizing behavior. For me the resizing area at the edges in anooyingly small in all apps, this seems to be a general issue with the Breeze theme.

@phw Excellent, that's so much better! This way it's easier to use on more unusual WMs as well; I'm currently running bspwm which doesn't do edge-resizing at all, making some version of AltRMB rather indispensable. That said, even when I was using KDE I pretty much never used the edges to resize, preferring SuperRMB.

I just tested on plasma 5.15 the newest release and breeze theme finally works! They fixed a lot of gtk theme problems in the latest release.

I can confirm that, latest Plasma finally fixed the issue somehow,
it's still very thin but at least doable!

peek 2019-02-13 11-28

@phw I think we can close this, seems to work fine now.

Still thin and impossible to resize for me, Peek 1.4.1 on bspwm

I'm here because it's thin and impossible for me to resize on my KDE Plasma desktop; I think it's because I've set window borders to none (they're thinner than in @atar-axis's image above, literally exactly one pixel wide). Other windows have a resize area that expands around the window a few pixels, but Peek doesn't seem to (perhaps because it's Gtk?)

Thanks for writing/maintaining this awesome utility, other than the lack of resizing my first experience was great!

In [ System settings ] -> [ Window management ] -> [ Window rules ] -> [ Appearance & Fixes ] , set [ No titlebar and frame] to No

In [ System settings ] -> [ Application Style ] -> [ Window decoration ] -> [ Breeze theme setting ] -> [ Window specific overrides ], Set [ border size ] to Normal and set [ Hide Window title bar ] to yes.

The last step differs a bit from the linked description. The border size should be set to Normal or Tiny, but not No border. With No border you would get an ugly resize triangle in the lower right border, which also is visible in recordings. Still this looks a bit odd, as there will be an extra frame around the Peek window, but it makes it usable.

It's an old issue, but I tried this workaround and it works great in Plasma (5.16.5). Setting the border size to "no borders" works fine if you uncheck "add handle to resize windows with no border" in Breeze's theme settings.

Peek 2019-09-29 03-53

This is still a problem for me even after trying to apply that work-around. I found that holding the alt key and doing a right-click-drag was the easiest way to resize the window.

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"

I'm using Awesome on Arch Linux and also am having trouble resizing. If changing the border size is too difficult I would also be happy with a way directly enter the size of the capture window.

@clofresh have you tried this branch? https://github.com/phw/peek/issues/199#issuecomment-374805943

Perhaps a way to snap to the geometry of existing windows (even as simple as providing a way to specify the window geometry via command line) would be an acceptable workaround?

If your on KDE hold have the peek window in the foreground (selected)

hold down ALT and use the right mouse button to click and drag corners to resize.

This works well for me.

EDIT: even then if you dont time your click shortly after pressing ALT it can be difficult to grab the corners or borders.

I can't understand why this is related to the theme being used. There should be a border with same thickness on every theme. This should be done by own code, not by depending on the theme or the desktop environment.

@ponchofiesta Because basically Plasma did not fully support GTK windows with client decorations, and for those the border is part of the application. That also means themes affect the border size.

But Plasma 5.18 actually fixes this, fully supporting GTK windows with client decoration, including drop shadow and bigger area around the window to grab for resizing. With this it now actually looks and works like on e.g. GNOME. I am going to close this issue as everything else that can be done here is just dirty workarounds and hacks.

grafik

Just wanted to post that I am on latest KDE (Ubuntu 18.04.4 and plasma-desktop standard breeze-dark theme) and still have trouble grabbing the bottom left and right corners to resize the peek windows. However if you right click on the title bar of the peek aplication you can choose the resize option, it works around the issue. I found this helpful.

@phw Don't depend on the window border. Make your own border. I'm not sure how that could be done in GTK. In .NET on Windows I would add some dummy controls of 3px width/height around and add handlers to adjust the cursor on mouse over and resize the window on click+move. Yes, it's still kind of dirty but it should work everywhere. Maybe you could add a parent GtkGrid (3x3) and move the current content to the center cell. Than place those dummy controls around. But I'm not sure if it is possible to set fixed width/height on those controls. But something like this might fix it.

@ponchofiesta Sorry, I'm not interested in reimplementing parts of Gtk and implement custom window handling just because Plasma does not handle this properly. Especially not since they now fixed it.

OK, I will continue to use Peek from Snap for now till Kubuntu 20.04.1 is out which hopefully comes with latest Plasma wich fixes it. Please don't remove it :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

grimmer-std picture grimmer-std  ·  6Comments

ronjouch picture ronjouch  ·  6Comments

jjnilton picture jjnilton  ·  7Comments

chteuchteu picture chteuchteu  ·  6Comments

Art-2 picture Art-2  ·  6Comments