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

[gnome 40] Slide workspace using gestures plays animation twice. #185

Open
MonsieurLanza opened this issue Sep 27, 2021 · 16 comments
Open
Labels
help wanted Extra attention is needed

Comments

@MonsieurLanza
Copy link

I just got my hands on a new laptop, which can handle gestures… You can slide workspaces with 3 fingers, left or right (yeah, there’s already an issue with the gesture itself here, in case of vertical sliding).

What happens is that when I slide a workspace (always horizontally, as I said), it re-plays the animation afterward, which is a somewhat awkward.

(may include video later on, if gnome-shell and my schedule let me record it)

@mzur mzur added the needs info Needs more information to continue label Oct 6, 2021
@mzur
Copy link
Owner

mzur commented Oct 6, 2021

Can someone with a device supporting gestures please confirm this?

@MonsieurLanza Is the animation correct if this extension is disabled?

@KristianOde
Copy link

This happens to me as well, on Fedora 34 Gnome 40.4. Most other ways of traversing workspaces look fine but using touchpad gestures does this double animation playback thing. It does not happen without this extension.

@mzur
Copy link
Owner

mzur commented Oct 14, 2021

Thanks @KristianUSN! Now we need someone with an appropriate device to have a look at the code.

@mzur mzur added help wanted Extra attention is needed and removed needs info Needs more information to continue labels Oct 14, 2021
@MonsieurLanza
Copy link
Author

Here is what happens, first without wsmatrix extension, then with it activated.
https://user-images.githubusercontent.com/4181623/137733240-442d3c04-0d85-4950-9a96-b8f6e2353283.mp4

Note that I only did simple swipe, the gnome animation follows the gesture : you can go back and forth when swiping.

@pnkov
Copy link
Contributor

pnkov commented Oct 20, 2021

@MonsieurLanza touchegg with <action type="SEND_KEYS"> for changing workspaces works perfectly for me. But I should mention that gnome-shell-extension-x11gestures does not needed for this case and causes some problems.

@Barben360
Copy link

Barben360 commented Feb 9, 2022

I can confirm the problem happens for me too, seems like the event "workspace changed from x to y" is triggerred after the gesture is over (always left-right or right-left) and so workspace matrix animation is played while visually we already have the feeling of being on the right workspace.

When using the keyboard only workspace matrix animation is displayed (with the right direction, including up/down).

Not sure that helps but that's what I think happens.

Note that now with gnome the gesture is not a single event but you can maintain it between 2 workspaces for instance, so the real action is at release.

@JorgeSivil
Copy link

Not sure what's the correct procedure but +1, having the same issue.

@myyc
Copy link
Contributor

myyc commented Jun 16, 2023

just to add some extra details, it's not actually true that the animation is played twice, rather, two things happen.

  • swiping (even partially) slides the desktops left or right. this is not an actual animation, rather, the reaction to the swipe (that can be interrupted), kind of like scrolling within a window
  • once you release the three fingers, the "animation" ends on the desktop, but then a gnome-shell animation gets triggered

this explanation is harder to understand in writing than to see in action, once you disable gnome-shell's animations it'll be clearer:
gsettings set org.gnome.desktop.interface enable-animations false
incidentally, i find that disabling animations works better with this extension in general, but you might disagree :)

@filipemiguel97
Copy link

I have the same issue. I agree with what myyc said. Also, even if animations are disabled the behavior is a bit glitchy. You see a flicker of the previous screen once you are done swiping.

@klondikemarlen
Copy link

I have the same issue on GNOME 44.2, Wayland, Ubuntu 23.04. When I disable the extension, workspace switching via swiping works fine, so the solution to this issue might be to remove the workspace switching code if the GNOME version is high enough? You would definitely need to keep the wrap-around feature though since GNOME doesn't support it. Wrap-around is my primary reason for using this extension :)

@4r7if3x
Copy link

4r7if3x commented Apr 7, 2024

I have the same issue on GNOME 45 and I have v43 of the extension installed. I'm not fond of disabling animations, although it would solve the problem. Is this going to be patched anytime soon?

@mzur
Copy link
Owner

mzur commented Apr 8, 2024

Is this going to be patched anytime soon?

Since I don't have the hardware to test this, someone else has to pick it up. I'm afraid this won't be anytime soon.

@4r7if3x
Copy link

4r7if3x commented Apr 8, 2024

Is this going to be patched anytime soon?

Since I don't have the hardware to test this, someone else has to pick it up. I'm afraid this won't be anytime soon.

Do you need a specific hardware for this? Doesn't this happen when you use the mouse?

@mzur
Copy link
Owner

mzur commented Apr 8, 2024

You need a trackpad or a touchscreen and I have neither.

@4r7if3x
Copy link

4r7if3x commented Apr 8, 2024

You need a trackpad or a touchscreen and I have neither.

I have the trackpad if I can be of any help, but I don't know where to start. Any guidance?

@mzur
Copy link
Owner

mzur commented Apr 9, 2024

You probably have to start with the custom WorkspaceAnimationController:

export class WorkspaceAnimationController extends GWorkspaceAnimationController {
_prepareWorkspaceSwitch(workspaceIndices) {
if (this._switchData)
return;
const workspaceManager = global.workspace_manager;
const nWorkspaces = workspaceManager.get_n_workspaces();
const switchData = {};
this._switchData = switchData;
switchData.monitors = [];
switchData.gestureActivated = false;
switchData.inProgress = false;
if (!workspaceIndices)
workspaceIndices = [...Array(nWorkspaces).keys()];
const monitors = Meta.prefs_get_workspaces_only_on_primary()
? [Main.layoutManager.primaryMonitor] : Main.layoutManager.monitors;
for (const monitor of monitors) {
if (Meta.prefs_get_workspaces_only_on_primary() &&
monitor.index !== Main.layoutManager.primaryIndex)
continue;
const group = new MonitorGroup(monitor, workspaceIndices, this.movingWindow);
Main.uiGroup.insert_child_above(group, global.window_group);
switchData.monitors.push(group);
}
Meta.disable_unredirect_for_display(global.display);
}
}

The original class has an animateSwitch method which should be responsible for the animation. This is not changed by this extension, however, so I don't know what's going wrong here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

10 participants