sparrow icon indicating copy to clipboard operation
sparrow copied to clipboard

[Improvement] Location of pop-ups on multiple monitor set-up

Open RequestPrivacy opened this issue 3 years ago • 4 comments

Maybe a minority use case but the location of some pop-ups (e.g. settings, show PayNym, password and passphrase entry dialog etc.) seem to be always on the primary monitor, even if the Sparrow client is on the secondary one (tested on two monitor set-up).

Other dialogs (e.g. About Sparrow) open correctly on the display where Sparrow currently resides.

Set-up:

  • Debian bullseye
  • Sparrow build from source with latest commits
  • Laptop display is primary
  • Monitor via HDMI is secondary

RequestPrivacy avatar Mar 24 '22 08:03 RequestPrivacy

Sparrow specifically tries to place any popups on the same monitor as the parent window. I'm unable to reproduce the described behaviour on Ubuntu 20.04 or OSX, so there must be something specific to your setup.

If you're running from source, you might try to investigate - the key method is AppServices.moveToActiveWindowScreen which is called whenever a popup is displayed. Either the active window is not being detected, detected incorrectly, or perhaps there is a timing issue (the way the method is called is slightly different in AppController.getAboutStage().

craigraw avatar Mar 26 '22 10:03 craigraw

Unfortunately I've just switched desktop environments and now it's working like a charm. I made the hop from GNOME to KDE Plasma so it seems this issue has nothing to do with Sparrow. Closing off.

RequestPrivacy avatar Mar 26 '22 17:03 RequestPrivacy

Have to reopen the issue as the problem seems to persist. I made following observations, maybe they help to find the root of the problem:

Setup:

  • Laptop: primary display
  • Monitor: secondary display
  • Window behavior in linux distro: focus on mouse hover (in contrast to "focus on mouse click" like most people have)

I start a terminal on the secondary display and open Sparrow with a Sparrow alias like so alias Sparrow='nohup Sparrow </dev/null &>/dev/null &' to suppress error messages and start Sparrow in the background so that I can continue working on the same terminal. Sparrow is in my path and links to the binary in sparrow/build/jpackage/Sparrow/bin/Sparrow

  • Sparrow starts but on the primary display
  • I move it to the secondary one (where the terminal is sitting)
  • I open a wallet, the password and passphrase popups also appear on the primary display although my mouse hovers over the secondary one
  • Once the first wallet is loaded I try to open another wallet, the password dialog (and any other popup) appears correctly over Sparrow on the secondary display.

So it seems that it's an issue during the first startup of Sparrow?

I myself don't know how to debug with the information you given above though - never done something java related and new to programming. Can you point me to the first steps so I can also investigate myself?

RequestPrivacy avatar Mar 30 '22 08:03 RequestPrivacy

The key method is https://github.com/sparrowwallet/sparrow/blob/b16c7345a8c3aaeff949ba478d2108a8a847fd35/src/main/java/com/sparrowwallet/sparrow/AppServices.java#L791

Try introducing System.out.println(currentScreen); in that method to start taking a look.

craigraw avatar Mar 31 '22 06:03 craigraw