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

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

Closed
davidv171 opened this issue Oct 23, 2017 · 60 comments
Closed

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

davidv171 opened this issue Oct 23, 2017 · 60 comments
Milestone

Comments

@davidv171
Copy link

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.

@phw
Copy link
Owner

phw commented Oct 23, 2017

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.

@davidv171
Copy link
Author

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.

@phw
Copy link
Owner

phw commented Oct 23, 2017

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.

@davidv171
Copy link
Author

Okay. Thank you for your time.

@cGuille
Copy link

cGuille commented Oct 25, 2017

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.

@phw
Copy link
Owner

phw commented Oct 25, 2017

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?

@cGuille
Copy link

cGuille commented Oct 25, 2017

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

@phw phw added the bug label Oct 30, 2017
@phw phw added this to the 1.2.0 milestone Oct 30, 2017
@pcj
Copy link

pcj commented Nov 2, 2017

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

@phw
Copy link
Owner

phw commented Nov 7, 2017

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.

@phw
Copy link
Owner

phw commented Nov 7, 2017

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.

@phw
Copy link
Owner

phw commented Nov 7, 2017

@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?

@davidv171
Copy link
Author

@phw yes it was ambiance.

@davidv171
Copy link
Author

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

@pcj
Copy link

pcj commented Nov 7, 2017

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

@cGuille
Copy link

cGuille commented Nov 8, 2017

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…

@phw
Copy link
Owner

phw commented Nov 17, 2017

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.

@pcj
Copy link

pcj commented Nov 17, 2017

@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.

@cGuille
Copy link

cGuille commented Nov 18, 2017

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.

@cGuille
Copy link

cGuille commented Nov 18, 2017

I made a screen capture of Peek (using Peek 😄 ) 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

@phw
Copy link
Owner

phw commented Nov 18, 2017

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.

@phw
Copy link
Owner

phw commented Nov 18, 2017

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.

@phw
Copy link
Owner

phw commented Nov 19, 2017

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.

@cGuille
Copy link

cGuille commented Nov 21, 2017

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.

@phw
Copy link
Owner

phw commented Nov 21, 2017

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..

@cGuille
Copy link

cGuille commented Nov 21, 2017

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.

@gandalf3
Copy link

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.

@atar-axis
Copy link

atar-axis commented Feb 17, 2018

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

@phw
Copy link
Owner

phw commented Mar 20, 2018

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.

@gandalf3
Copy link

@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.

@gort818
Copy link
Contributor

gort818 commented Feb 13, 2019

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.

@atar-axis
Copy link

atar-axis commented Feb 13, 2019

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

@gort818
Copy link
Contributor

gort818 commented Jun 29, 2019

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

@gandalf3
Copy link

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

@benjie
Copy link

benjie commented Jul 27, 2019

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!

@ghost
Copy link

ghost commented Sep 29, 2019

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

@eschoeller
Copy link

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"

@clofresh
Copy link

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.

@gandalf3
Copy link

@clofresh have you tried this branch? #199 (comment)

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?

@Jieiku
Copy link

Jieiku commented Feb 22, 2020

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.

@ponchofiesta
Copy link

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.

@phw
Copy link
Owner

phw commented Feb 27, 2020

@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

@phw phw closed this as completed Feb 27, 2020
@Jieiku
Copy link

Jieiku commented Feb 27, 2020

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.

@ponchofiesta
Copy link

@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.

@phw
Copy link
Owner

phw commented Feb 27, 2020

@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.

@ponchofiesta
Copy link

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 :-)

@chikamichi
Copy link

In KDE/Plasma, one may tweak a specific window's config. Here's an example (French UI):

ksnip(55)
ksnip(56)

  1. Launch Peek.
  2. Open System Settings > Window Management > Window Rules. Add a new config entry. The goal here is to define a rule which will automatically apply custom settings to a matching window, based on detection rules.
  3. Name it whatever you like (here: Peek), and click "Detect Window Properties". Click on Peek's window. Validate the settings to fill-in the config entry. You may enable "Match whole window class" for a more precise matching (likely not to be necessary in this case).
  4. In the "Appearance & Fixes" tab…
  5. … enable the first rule to force borders onto Peek's window. Warning: this rule is negative, so make sure to enable "No" as a setting to actually force borders to appear.
  6. Don't forget to Apply this new rule. Relaunch Peek and voilà !

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