Bug 443723 - "Display geometry when moving or resizing" feature is missing
Summary: "Display geometry when moving or resizing" feature is missing
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.24.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
: 449842 450629 454025 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-10-14 15:37 UTC by Till Schäfer
Modified: 2024-03-07 16:54 UTC (History)
19 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Till Schäfer 2021-10-14 15:37:40 UTC
enabling the setting 
  systemsettings -> window behavior  -> movement -> display geometry when moving or resizing 
does not have any effect under wayland.


Operating System: Gentoo Linux
KDE Plasma Version: 5.23.0
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.14.10-gentoo (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-4810MQ CPU @ 2.80GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4600
Comment 1 Vlad Zahorodnii 2021-10-15 05:22:00 UTC
Iirc it's implemented only for x11 windows
Comment 2 Chiitoo 2022-01-26 18:04:14 UTC
Since fcf0b4796f5 [1] this is gone for X11 as well.

Should there perhaps be a separate bug requesting a replacement feature?

I for one used this surprisingly much, and I do consider my use-case rather regular in nature.  :]

Thanks!

1. https://invent.kde.org/plasma/kwin/-/commit/fcf0b4796f55fc15aa60a339ea40cdbb4573f9b8
Comment 3 Vlad Zahorodnii 2022-01-28 11:19:27 UTC
> I for one used this surprisingly much, and I do consider my use-case rather regular in nature.
What did you use it for?
Comment 4 Chiitoo 2022-01-28 15:35:13 UTC
(In reply to Vlad Zahorodnii from comment #3)
> > I for one used this surprisingly much, and I do consider my use-case rather regular in nature.
> What did you use it for?

Nothing /too/ specific really, that I can think of right now.

Mostly it's probably just that I've become very accustomed to having different windows be of a particular size, which can actually be very useful when taking screenshots or video off of them (no need to resize them later for example).

Somewhat similarly, it has been very useful in keeping aspect ratios and such as they should be for games, especially older ones, which don't have built-in options to set the resolution right (this also goes for the images and video in some cases).

There might be more specific things I've used this for, but can't think of right now.

I can't imagine being the only one making so much use of this, but I do also understand removing it if there are only a handful of us.

Thanks!
Comment 5 Vlad Zahorodnii 2022-01-31 08:32:11 UTC
Yeah, those sound like really niche usecases. The reason the geometry tip was dropped so async geometry updates could be simplified on wayland, which turned out to be a very difficult problem to get right..

That being said, the scripting api provides everything that's needed to re-implement this feature and it would be a much nicer way to implement geometry tip than the old way. I can look into it but I can't guarantee that it will be done soon. If somebody wants to do that themselves and upload the script to kde store, feel free to ask questions about scripting in #kde-devel on libera.chat or kwin matrix channel.
Comment 6 Vlad Zahorodnii 2022-01-31 08:33:03 UTC
#kde-kwin
Comment 7 Vlad Zahorodnii 2022-02-09 12:30:18 UTC
*** Bug 449842 has been marked as a duplicate of this bug. ***
Comment 8 Sebastian E. 2022-02-09 13:11:48 UTC
Yet another feature dropped. :/

I skimmed through the scripting documentation (https://develop.kde.org/docs/extend/plasma/scripting/api/), and need some hints. How can I register a listener for window events like resize/move, and how can I create a tip, which would be a top level window without decoration, I guess?
Comment 9 Vlad Zahorodnii 2022-02-09 13:21:40 UTC
(In reply to Sebastian E. from comment #8)
> Yet another feature dropped. :/
> 
> I skimmed through the scripting documentation
> (https://develop.kde.org/docs/extend/plasma/scripting/api/), and need some
> hints. How can I register a listener for window events like resize/move, and

workspace.clientAdded.connect((client) => {
    client.clientStartUserMovedResized((client) => console.log("interactive move resize started", client.caption);
    client.clientStepUserMovedResized((client, rect) => console.log("geometry changed", rect.x, rect.y, rect.width, rect.height));
    client.clientFinishUserMovedResized(() => console.log("interactive move resize finished");
});

> how can I create a tip, which would be a top level window without
> decoration, I guess?

you could create a plasma dialog dynamically (see https://doc.qt.io/qt-5/qtqml-javascript-dynamicobjectcreation.html) when the clientStartUserMovedResized signal is emitted and destroy it when the clientFinishUserMovedResized signal is emitted

    PlasmaCore.Dialog {
        location: PlasmaCore.Types.Floating
        flags: Qt.X11BypassWindowManagerHint | Qt.FramelessWindowHint
        x: client.x + client.width / 2 - width / 2
        y: client.y + client.height / 2 - height / 2

        Label {} // a label with geometry text
    }
Comment 10 Vlad Zahorodnii 2022-02-09 13:24:01 UTC
https://invent.kde.org/plasma/kwin/-/tree/master/src/scripts/desktopchangeosd/contents/ui the desktopchangeosd script is a good example how to write a kwin script that creates a window
Comment 11 Patrick Silva 2022-02-21 11:14:36 UTC
*** Bug 450629 has been marked as a duplicate of this bug. ***
Comment 12 Michael Tunnell 2022-04-15 18:05:35 UTC
I am disappointed to see this removed intentionally. I used this feature all the time to resize windows for different usecases. I'll provide one of the critical examples I use it for. I'm a podcaster on Destination Linux and during preparation we have individual windows for each camera. I resize the windows to 1080p so that I can capture them via OBS. This feature made it very easy and simple to make sure I always had it at the right sizing and positioning for capture. The first episode we recorded after I updated to 5.24 actually sent me into a panic because I didnt have time to figure out what happened. Luckily I already knew how to workaround this with wmctrl so I did that and have been doing so ever since.

I decided to see if there was a bug report to add my need to today and see that it was intentionally removed without warning. I don't know how I would be able to be warned as I am not sure there is a change advisory thing but that would be very helpful as a side note.

I now see that wmctrl does not work on Wayland so this feature being removed in KWin and my workaround only works in X means this will eventually create a bigger problem for me later.

Note: this is not the only reason I use this feature, this was also great for a lot of other reasons and was a great way to show people why KWin was awesome because everyone has different reasons to find this helpful.
Comment 13 Nate Graham 2022-04-18 14:23:00 UTC
That seems like a very valid use case. Re-opening. The commit message that dropped it said the following:

> If needed, one can reimplement this feature as a QtQuick script that creates
> an overlay window positioned above the window that is being interactively
> moved or resized.

So it looks like that's our path forward.
Comment 14 Patrick Silva 2022-05-19 12:07:26 UTC
*** Bug 454025 has been marked as a duplicate of this bug. ***
Comment 15 Richard Qian 2022-06-20 18:00:58 UTC
Since it seems nobody stepped up to make a replacement, I decided that I do most of the work. This is a reimplementation based off the desktopchangeosd script that functions mostly like the old version. I thank Vald for helping me get started with the code.

Original location: https://gitlab.com/Worldblender/kwin-scripts
My KWin fork containing this script: https://invent.kde.org/rqian/kwin

I'm considering to upload this script to the KDE store so others that are stuck with Plasma versions that previously removed this feature can download it without waiting for a new Plasma version.
Comment 16 Richard Qian 2022-06-20 18:24:51 UTC
Okay, I now have a draft merge request opened up: https://invent.kde.org/plasma/kwin/-/merge_requests/2553
I marked it as a draft, because there's a few things that need to be worked on before it's ready, including some translation work that I can't do myself.
Comment 17 Michael Tunnell 2022-06-20 19:36:19 UTC
Thank you very much for putting in the time to work on this Richard, having this back is much appreciated for my media production workflow!
Comment 18 Richard Qian 2022-06-20 21:03:30 UTC
As my implementation has not yet been merged upstream, I uploaded it to the KDE store so others can get it more easily until then: https://www.pling.com/p/1833846/
Comment 19 Stefan Kaerst 2022-07-17 06:36:23 UTC
(In reply to Vlad Zahorodnii from comment #3)
> > I for one used this surprisingly much, and I do consider my use-case rather regular in nature.
> What did you use it for?

I use that information to change terminal settings. for example, if you have VMs running and do a "virsh console <vm>" your terminal does not get the correct geometry, which is "stty size" shows 0 0 ... with the information from KDE about actual window size (of that terminal window) I can do a "stty cols X rows Y" and set the right geometry. this way the text scrolling and automatic newlines (infocmp -f | grep am) does work again correctly.

other than that. together with the destkop effect "snap helper" it's just a cool feature. I want't miss it! it makes the windows (l)users a bit more jealous and distinguish as from them. ;)
btw. what's the point with removing a feature that is already there? someone invested work to get it working, so why not using it?

HTH
Comment 20 Stefan Kaerst 2022-07-17 07:04:54 UTC
^^ another use of window geometry is this (at least for me)

I sometimes need to take screenshots of windows with the xdotool "import". to get a screenshot of e.g. a browser without borders I need to locate with window with the perfect size to location -25 -100.  if I then click a second time to resize/move this browser window with ALT+left mouse or ALT+right mouse button ... the new window positon is shown as +0+0 so I can perfectly resize to window 1280x1024 !!  (although the actual window is bigger because of location outside the upper left corner.
this all would be imposible without window geometry beiing show constantly .. I would have to use xwininfo all the time, but this is just unpractical.

HTH
Comment 21 David Chmelik 2022-07-17 08:35:31 UTC
(In reply to Vlad Zahorodnii from comment #3)
> > I for one used this surprisingly much, and I do consider my use-case rather regular in nature.
> What did you use it for?

I'm a mathematician/geometer/artist so have many obvious cases: specific-size graphics, learning GUI CS, even just some extreme user precision, some of which also happen multiple/many times during many hours daily.
Comment 22 rlk 2023-05-04 23:52:27 UTC
I'm likewise very unhappy to see this gone (running X11).  I don't believe that that script would do the right thing for fixed width text oriented apps such as emacs or xterm, where geometry in pixels is not relevant, it's width in characters that matter.

I frequently want windows to be of a specific width (in characters) so that e. g. if I'm creating text output I can easily see whether the output will overflow 80 or 132 columns.
Comment 23 Kevin Chadwick 2023-07-04 18:49:27 UTC
I found this vefy usegul for developing guis whether desktop, websites or flutter. Reactive guis change behaviour upon width chsngesanf it is nice to hsve that information reactively.
Comment 24 Maciej Stanczew 2024-01-30 12:49:14 UTC
I've been using Richard's script (from comment #15) for a while now, and it works flawlessly.

Can it really not get added to the default list of KWin Scripts? It would stay disabled for most users, but it would be much easier to discover for those of us who used this feature in the past.