pop-os / cosmic-comp

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

[Feature Request] Focus follows mouse for tiling mode #564

Closed sa7dse closed 2 months ago

sa7dse commented 5 months ago

This should be an option that users can enable and disable to suit their workflow.

(I hope i created this in the correct project)

Drakulix commented 5 months ago

New focus options, specifically:

are already planned post alpha 1. :)

digitalethics commented 4 months ago

I found the Xfce settings for the focus model quite intuitive and add a screenshot here for reference: focus model_xfce

skewballfox commented 4 months ago

Open to PRs for this?

Drakulix commented 4 months ago

Open to PRs for this?

Sure, though for the exact semantics, I would suggest pinging @pop-os/ux. From what I remember we had agreed to support additional modes as layed out in https://github.com/pop-os/cosmic-comp/issues/564#issuecomment-2180392519, but not talked about a much more comprehensive customization story as shown for Xfce in https://github.com/pop-os/cosmic-comp/issues/564#issuecomment-2186678725.

What would certainly be welcome, is being able to configure all of this through cosmic-config files for cosmic-comp and not yet exposing them in cosmic-settings until we have finalized designs. And that might even include customizable delays, though we might never expose them in our configuration UI.

skewballfox commented 4 months ago

Sure, though for the exact semantics, I would suggest pinging @pop-os/ux.

dumb question, how do I do that? I tried searching chat.pop-os.org for a channel or user name ux, and for a repo under pop-os. no luck with either

Drakulix commented 4 months ago

So after discussing this internally, we have come to a different conclusion at how this should work:

To facilitate this, we will need a bit of refactoring, as to what previously was the active_output of a seat. Parts of the code assume that output will contain a focused element. But with this change conceptionally the "focused output" and the "active output" (the one with the cursor on) will now be different things.

For configuration options, we will add two toggles:

digitalethics commented 4 months ago

Focus follows cursor (enabled): Clicking, launching, moving to a window with shortcuts/launcher, and moving the cursor into a new window focuses the window.

Would there still be any option to focus a window by just moving the mouse cursor over it without clicking as is the case in Xfce? @Drakulix

skewballfox commented 4 months ago

@Drakulix to clarify, all the behaviors listed in the first section are the new defaults? i.e. when both toggles are false(or yet to be implemented) these will be how cosmic-comp behaves.

Mainly asking because bullet point 3 seems to contradict the behavior laid out with Focus follows cursor.

@digitalethics if I'm not mistaken, that's what is meant by Focus follows cursor

Drakulix commented 4 months ago

Focus follows cursor (enabled): Clicking, launching, moving to a window with shortcuts/launcher, and moving the cursor into a new window focuses the window.

Would there still be any option to focus a window by just moving the mouse cursor over it without clicking as is the case in Xfce? @Drakulix

Yes, that is the first toggle.

Drakulix commented 4 months ago

@Drakulix to clarify, all the behaviors listed in the first section are the new defaults? i.e. when both toggles are false(or yet to be implemented) these will be how cosmic-comp behaves.

Mainly asking because bullet point 3 seems to contradict the behavior laid out with Focus follows cursor.

Both toggles to false will be the default and should largely correspond to cosmic-comps current behavior. Exceptions to this are of course moving the mouse onto another empty display doesn't take focus away and currently some shortcuts to warp the cursor, like switching the output via keyboard. So we might need to refine toggle 2 slightly to represent that.

pabloavi commented 3 months ago
  * Focus follows cursor (enabled): Clicking, launching, moving to a window with shortcuts/launcher, **and** moving the cursor into a new window focuses the window.

@Drakulix Would it be possible to change the focus when the cursor moves and not only when it moves into a new window? In GNOME, the only option is the known 'sloppy focus' (focus changes if cursor moves into a window), but most window managers can do the following: if the cursor is inside a window but does not move, focus does not change, if it moves inside the unfocused window, focus changes to that window.

theduke commented 2 months ago

I'm seconding the request for "focus follows mouse" as an option.

This is how I've been using sway for a long time, and it is by far the most intuitive way to work if you use a mix of mouse and keyboard interaction.