pop-os / cosmic-comp

Compositor for the COSMIC desktop environment
GNU General Public License v3.0
443 stars 64 forks source link

Clicking on cosmic window headers starts dragging in tiling mode #164

Closed hojjatabdollahi closed 5 months ago

hojjatabdollahi commented 11 months ago

In tiling mode, if you click on windows with cosmic window decoration (such as comsic-settings, cosmic-text-editor, gimp) starts moving the window and rearranges your tiling layout. Other type of headers (for example gnome-terminal) doesn't cause this.

video.webm

Drakulix commented 11 months ago

Dragging tiled windows is a feature and expected. (Though it looks quite janky in our recording, are you releasing the button immediately again?)

Client-side decorations may or may not implement this feature and there is nothing we can do about it. That said, gnome-terminal definitely works on my system. Can you check by chance which commit of cosmic-comp you are specifically running?

hojjatabdollahi commented 11 months ago

@Drakulix oh. I didn't state the issue properly. My bad. I meant to report the janky behavior that you mentioned.

What I meant to say is dragging works correctly for gnome-terminal. When you click on the header the window is focused and that's it. Then if you start dragging the window (moving your mouse) then cosmic comp goes into window arrangememt mode. So, if I want to just focus a window, I can just click on its header. Everything works correctly for gnome-terminal.

But for cosmic-settings as soon as you press down the mouse 1 key, it switches to window arrangement mode. In this recording I'm clicking ( and immediately releasing the button, without moving the mouse) and the layout is changing.

All I am trying to do in this recording is to click on a window decoration to focus that window. It works fine for some windows and messes up the arrangement in some other.

Drakulix commented 11 months ago

But for cosmic-settings as soon as you press down the mouse 1 key, it switches to window arrangement mode. In this recording I'm clicking ( and immediately releasing the button, without moving the mouse) and the layout is changing.

Now I get it, that is very unfortunate. I will try to replicate and address this, thanks!

Drakulix commented 11 months ago

This is an issue of the HeaderBar-widget of libcosmic, that currently fires on_drag handlers immediately after a click was registered instead of waiting for mouse movement after a click (which would be in line with what GTK is doing for example).

libcosmic applications like cosmic-settings are affected just like server-side decorations in cosmic-comp, as they share the same code. The issue is already being addressed in libcosmic and this bug will thus be fixed by an upcoming libcosmic update. I will update the issue once that is done.

XV-02 commented 5 months ago

Thanks for bringing this to our attention hojjatabdollahi. https://github.com/pop-os/libcosmic/commit/9963629a4f62ecb6f5496d92a5a8a4a1f5db302d resolves this issue :tada: , so I'm going to close it out.

hojjatabdollahi commented 4 months ago

@Drakulix Not sure if you're aware. But this issue is back. Chrome, and Alacritty has this issue, but everything else is fine.