nheko icon indicating copy to clipboard operation
nheko copied to clipboard

Full screen image appears on wrong monitor

Open UgnilJoZ opened this issue 3 years ago • 12 comments

Describe the bug

When using nheko on a secondary screen, clicking on an image displays the image in fullscreen on the primary monitor.

To Reproduce

  1. Enter a Gnome Wayland session (Nvidia on my side) with a two-monitor setup
  2. Put nheko on the secondary monitor
  3. Select a chat
  4. Click on an image to display it full-screen

What happened?

The image is displayed in full screen on the other (primary) monitor.

(Subsequent clicks on the image open more and more image viewers on top of the first one.)

Additionally, sometimes on the first try after starting nheko, the image message is only selected instead of show in full screen.

Expected behavior

I would have expected the image to appear as overlay on top of the chat window.

Screenshots

Primary monitor on the bottom, secondary on top

Version

0.9.3-9bac429

Operating system

Linux

Installation method

Flathub

Qt version

No response

C++ compiler

No response

Desktop Environment

Gnome (Wayland)

Did you use profiles?

  • [ ] Profiles used?

Relevant log output

No logs are generated during the event of showing images.

Backtrace

No response

UgnilJoZ avatar Mar 25 '22 11:03 UgnilJoZ

Nheko uses a separate window to display images. It should open on the same monitor, but we have no control over that on wayland. So you need to configure your window manager to do the right thing, I think?

deepbluev7 avatar Mar 25 '22 15:03 deepbluev7

I also am encountering this same issue on Pop OS 22.04 using X11, so it isn't just a wayland issue. Nheko opens on my primary monitor, but regardless of where I put the nheko window, the image viewer always pops up over my secondary display (and clicking the image again in confusion opens more image previews)

I personally would think that further image previews shouldn't open if you keep clicking, unless there's a use case for that I'm missing, but that's obviously a lower priority/basically a non-issue if the popup was always covering the main UI.

ceandreasen avatar Oct 21 '22 20:10 ceandreasen

I also have the same issue on sway/wayland. The fullscreen image viewer seems to favor my rightmost monitor currently, which is a tiny Steam Deck screen...

Also, it's weird that the window is a fullscreened borderless pop-up. I would have imagined a normal window, or a fullscreen window. Preferably with server-side decorations still (decorations are hidden when full-screen anyway).

swaymsg -t get_tree output with nheko preview window

"floating_nodes": [
            {
              "id": 133,
              "type": "floating_con",
              "orientation": "none",
              "percent": 1.1010752688172043,
              "urgent": false,
              "marks": [],
              "focused": false,
              "layout": "none",
              "border": "csd",
              "current_border_width": 2,
              "rect": {
                "x": 2688,
                "y": 0,
                "width": 1280,
                "height": 800
              },
              "deco_rect": {
                "x": 0,
                "y": 0,
                "width": 0,
                "height": 0
              },
              "window_rect": {
                "x": 0,
                "y": 0,
                "width": 1280,
                "height": 800
              },
              "geometry": {
                "x": 0,
                "y": 0,
                "width": 500,
                "height": 500
              },
              "name": "nheko",
              "window": null,
              "nodes": [],
              "floating_nodes": [],
              "focus": [],
              "fullscreen_mode": 1,
              "sticky": false,
              "pid": 32405,
              "app_id": "io.github.NhekoReborn.Nheko",
              "visible": true,
              "max_render_time": 0,
              "shell": "xdg_shell",
              "inhibit_idle": false,
              "idle_inhibitors": {
                "user": "none",
                "application": "none"
              }
            }
          ],

MayeulC avatar Jun 21 '23 12:06 MayeulC

The bug is still persistent on X11 and wayland. Any updates on this?

TomTheDragon avatar Jan 05 '24 02:01 TomTheDragon

The bug is still persistent on X11 and wayland. Any updates on this?

Sure: Nobody fixed it in Qt yet.

deepbluev7 avatar Jan 05 '24 02:01 deepbluev7

Sure: Nobody fixed it in Qt yet.

Thanks! Is there an upstream bug report we can track or work on?

ceandreasen avatar Jan 05 '24 13:01 ceandreasen

Nheko uses a separate window to display images.

If it is not possible to control where it is opened, then may there be a better technical approach to the image preview than opening an additional window? Something like an overlay component within the existing window?

It should open on the same monitor, but we have no control over that on wayland.

There seems to be some kind of influence an application can exert.

If I click on an image in Telegram desktop, it opens a new window on top the existing one and on the same monitor. (Unless the window spans over multiple screens, then it seems to be a little more random).

UgnilJoZ avatar Mar 17 '24 20:03 UgnilJoZ