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

[Bug]: File upload with drag & drop not working (randomly) on GNOME with Wayland #3268

Open
6 tasks done
leoniscsem opened this issue Dec 23, 2024 · 1 comment
Open
6 tasks done

Comments

@leoniscsem
Copy link

leoniscsem commented Dec 23, 2024

Checks before filing an issue

Mattermost Desktop Version

5.10.2 commit de876ca (snap installation)

Operating System

Ubuntu Linux 22.04 LTS x64, GNOME 42.9 with Wayland

Mattermost Server Version

10.3.1 (deb installation)

Steps to reproduce

  1. have a GNOME session with Wayland window manager
  2. go to any channel
  3. drag and drop a file from file manager

Expected behavior

After dragging a file to the main window of Mattermost, the background should go black and show the "drop file here to upload" dialogue. After releasing the file, it should be uploaded.

Observed behavior

The behaviour is not consistent. Sometimes it works on the first try. The second try then usually does not work, no dark background / upload message.
Sometimes wiggling the file while hovering over the main channel triggers the dark upload background, sometimes not.
Sometimes it results to an error message "file cannot be uploaded".
Not dropping the file when no upload dialogue appears and re-grabbing it, then trying to drop it again sometimes yields results.

Log Output

no relevant output from main.log, only this (log level debug)

[2024-12-23 16:58:24.307] [debug] [MainWindow] saving window state {
  x: 1920,
  y: 0,
  width: 1920,
  height: 1080,
  maximized: true,
  fullscreen: false
}
[2024-12-23 16:58:36.897] [debug] [ViewManager] handleSetCurrentViewBounds { x: 1920, y: 0, width: 1920, height: 1080 }
[2024-12-23 16:58:36.899] [debug] [ModalManager] handleResizeModal {
  bounds: { x: 1920, y: 0, width: 1920, height: 1080 },
  modalQueueLength: 0
}
[2024-12-23 16:58:36.902] [debug] [ViewManager] focusCurrentView
[2024-12-23 16:58:40.262] [debug] [ViewManager] handleSetCurrentViewBounds { x: 1920, y: 0, width: 1920, height: 1080 }
[2024-12-23 16:58:40.264] [debug] [ModalManager] handleResizeModal {
  bounds: { x: 1920, y: 0, width: 1920, height: 1080 },
  modalQueueLength: 0
}
[2024-12-23 16:58:40.265] [debug] [MainWindow] saving window state {
  x: 1920,
  y: 0,
  width: 1920,
  height: 1080,
  maximized: true,
  fullscreen: false
}

Additional Information

The upload dialogue seems to be triggered randomly. I have tested the file upload functionality on Firefox 133.0.3 (deb) and Chomium 131.0.6778.139 (snap). My assumption is the issue is related to either the xwayland package (2:22.1.1-1ubuntu0.14), or Google's Wayland interpreter for Electron apps.

I do not face this issue when loading an X-server session for GNOME.

@devinbinnie
Copy link
Member

I'm not sure if I'm seeing exactly what you're seeing, but I am seeing a bit of inconsistency in the responsiveness of the upload screen in the app. I went ahead and set ELECTRON_OZONE_PLATFORM_HINT=wayland in my .desktop file and it seemed to be a bit better. Perhaps give that a try?

My .desktop file for reference:

[Desktop Entry]
X-SnapInstanceName=mattermost-desktop
Name=Mattermost
X-SnapAppName=mattermost-desktop
Exec=env ELECTRON_OZONE_PLATFORM_HINT=wayland BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/mattermost-desktop_mattermost-desktop.desktop /snap/bin/mattermost-desktop %U
Terminal=false
Type=Application
Icon=/snap/mattermost-desktop/769/meta/gui/icon.png
StartupWMClass=Mattermost
Comment=Mattermost
MimeType=x-scheme-handler/mattermost;
Categories=Network;InstantMessaging;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants