vscode: Drag and drop does not work in Wayland

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.69.2
  • OS Version: Manjaro Linux, Kernel: 5.15, Wayland, WM: sway

Steps to Reproduce:

  1. Add --enable-features=UseOzonePlatform --ozone-platform=wayland to code-flags.conf
  2. Open code
  3. Attempt to drag tabs, files, or anything else
  4. Does not give any indication that they are being dragged, and the elements to not get moved around

I am unable to re-order windows, create multiple panes with drag and drop, etc

It works if I do not add the flags. The issue is I need the flags for scaling in Wayland.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 56
  • Comments: 54 (9 by maintainers)

Most upvoted comments

I’m also seeing an issue like this with Plasma 6 RC2 on Wayland. Running vscode on XWayland does seem to work, but has other issues (like rendering glitches). A few things like text do work, but I can’t drag a tab.

When I try, VSCode acts like it’s working (you get the ‘shine’ that indicates the tab will get tiled, for example). But when I release my mouse, nothing happens.

The about window has the following:

Version: 1.86.2
Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda
Date: 2024-02-13T19:41:37.860Z
Electron: 27.2.3
ElectronBuildId: 26908389
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Linux x64 6.6.13-gentoo-dist

For me with the official build, drag&drop works mostly fine, except for certain operations.

Drag & drop selection = OK Moving tabs around = OK Creating split views from drag&drop = OK Reordering sidebar tabs = fail Moving to secondary sidebar = fail

disconfirming with both vscode 1.78 and insiders 1.79. I think I made a mistake earlier by not passing the right arguments to code-insiders, so I was testing the X11 version.

reordering sidebar tabs does not work, neither does secondary sidebar. both actions work fine when ozone platform is x11

FYI: Today i got updates for my system (Arch), now i have plasma 6.0.2 and also new vscode, and now drag/drop works with wayland

Revisited this today, I see dnd operation to work fine with latest insiders based on Electron 27 under Ubuntu 22.04 and Gnome 42.9. Can others confirm as well.

@deepak1556 I am pretty sure you opened vscode as xwayland client, rather than a native wayland client while testing and confirming that it works.

Yes, it works as an x11 client, but this issue is about drag/drop for the wayland client.

Please make sure your vscode is properly closed, and then open it using code --ozone-platform-hint=auto. Validate if you are indeed looking at a native wayland client by either running xprop or xwininfo and hovering your mouse over your vscode and clicking. If the cursor changes to a crosshair and clicking prints window intormation, it is still an x11 (xwayland) window. If it stays the default cursor and clicking it doesn’t print any output, then it is a proper wayland client.

And once you made sure it is a wayland client, re-test drag and dropping a panel from the left to the right side.

edit: I am saying this because I just had someone on gnome test this with a wayland client, and drag and drop does not work for them.

Same on Manjaro Gnome 45.2. 18 months and it’s still not fixed, a joke.

Why the issue was closed? As the author mentioned above: Reordering sidebar tabs = fail Moving to secondary sidebar = fail

For me those actions are bugged too. Maybe we should create a separate issue for them?

For what it’s worth, I can also reproduce this bug (on sway) but only when the title bar style setting is set to native. When using the custom title bar, drag-and-drop seems to work as expected.

the real funny part: it works for me too when i drag the view outside of vscode, move it over my desktop and then drop it to the right (or left). Screencast_20240314_131952.webm

I was hoping this would also work with sway but it does not; my current workaround is to launch vscode as an X11 application, making the panel drag & drop changes I want, closing vscode and re-opening it with the wayland flags re-enabled

I can confirm the same. KDE Plasma 6 on Wayland, Electron v27.3.5.

Having the same Problem on Plasma 6.0

Version: 1.86.2 Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda Date: 2024-02-13T19:41:37.860Z Electron: 27.2.3 ElectronBuildId: 26908389 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Linux x64 6.7.7

I can drag Stuff, but when releasing (for example having 2 files side by side) nothing happens.

@deepak1556 Just for completeness, under sway, drag and drop still doesn’t work for many things like re-ordering panels, it does for tabs though. But please do have a look at the issues under sway, the crashes and the drag/drop issues are almost unbearable.

edit: also for completeness, this doesn’t just affect sway, it affects all wlroots based compositors, and also all smithay based compositors (like the new popos one, which is gonna be a pretty big group as well). I’m taking your word for it that this doesn’t affect gnome, since I didn’t test it. But that’s just one of many compositors that are apparently not affected.

Im facing this issue, doesnt happen on Windows. I’m used to just drag files from Explorer/Nautilus into the editor, for some reason it fails the majority of the time but works sporadically. See video: Screencast from 2023-09-25 14-58-30.webm

+1 I can confirm this bug exists on freshly installed Ubuntu 22.04 LTS

Does not work for me either in insiders.

Some Elements I try to drag behave same as in older builds (e.g. can drag them but the do not change their location after dropping)

Other elements make the whole app crash when trying to drag them somewhere…

Closing as we will be shipping Electron 22 update with v1.78

~/verified~

think i made a mistake here

For what it’s worth, I can also reproduce this bug (on sway) but only when the title bar style setting is set to native. When using the custom title bar, drag-and-drop seems to work as expected.

Thank you very much this solved my problem!

the real funny part: it works for me too when i drag the view outside of vscode, move it over my desktop and then drop it to the right (or left). Screencast_20240314_131952.webm

FYI: Today i got updates for my system (Arch), now i have plasma 6.0.2 and also new vscode, and now drag/drop works with wayland

@ulrichSchreiner did you test dragging a panel from one side to the other? Because that still doesn’t work on my arch: 2024-03-14.11-27-45.mp4

I’ve just tried it on my system and it works fine. I’m KDE Plasma 6.0.2 and Code running as a Wayland (with --enable-features=UseOzonePlatform --ozone-platform=wayland)

Screencast_20240314_125634.webm

FYI: Today i got updates for my system (Arch), now i have plasma 6.0.2 and also new vscode, and now drag/drop works with wayland

@ulrichSchreiner did you test dragging a panel from one side to the other? Because that still doesn’t work on my arch:

https://github.com/microsoft/vscode/assets/1282767/fed5ff18-aaa0-4d88-b3f4-e68b3afbf277

FYI: there is a issue in KDE’s bugzilla which i think is the same problem.

https://bugs.kde.org/show_bug.cgi?id=482142

so i think this is not really a VSCode problem (at least when using plasma6).

@ouzdll I don’t know where Electron 22.5.5 comes from 😕. It doesn’t seem to be a formal release. However, Electron 22.3.12 on Arch fixes this, as noted here: https://bugs.archlinux.org/task/78753

@deepak1556 There may be several issues at play, since the insiders release does fix the problem for me on Sway/Arch Linux. Looking forward to the next release!