mypaint / mypaint

MyPaint is a simple drawing and painting program that works well with Wacom-style graphics tablets.
https://mypaint.app
GNU General Public License v2.0
2.7k stars 386 forks source link

Use last used pointer for dialog/popup placement #311

Open amarao opened 9 years ago

amarao commented 9 years ago

X server has feature: multipointer x (MPX). In this mode there are few cursors.

One can enable it by following commands:

xinput --create-master 'second'
xinput --attach "Wacom Cintiq 13HD stylus" "second pointer"

After that there is possible to work in mypaint without loosing focus in other applications (games, movies, etc).

But all hotkeys dialogs are displayed at the position of primary cursor, not the active one, used for drawing. Is any way to say mypaint where to show dialogs? Or, at least, to restrict to current xrandr output?

achadwick commented 9 years ago

What version of MyPaint is affected, please?

(This is likely to be a WONTFIX, given that most X servers aren't configured like yours.)

achadwick commented 9 years ago

Also, which dialogs are affected? I think that popups may be affected, but most if not all of our dialogs are screen- or window-centered.

achadwick commented 9 years ago

Finally, which OS and desktop environment are you using?

amarao commented 9 years ago

Hello. Sorry.

Versions: mypaint 1.1.0-3 Linux x86_64 xfce4 4.10 (@debian sid)

Affected dialogs: 'b', 'c' - displayed completely wrong (right under the 'wrong' cursor) 'B', 'C' - displayed at the bottom of the wrong monitor (where 'wrong' cursor is) Layer, layer rename and scratchpad dialogs appears normally Save/Load dialogs appears in the middle of proper screen.

achadwick commented 9 years ago

Okay, thanks. Does it matter that you're running a multi-monitor setup for the purposes of this issue?

1.1.0 is pretty old now. The behaviour of these keys changed recently on master - are you able to re-test against git master with a local build? Check out https://github.com/mypaint/debian if you want it package-managed, or just run it from the build tree for testing (https://github.com/mypaint/mypaint/blob/master/README_LINUX.md)

I'm having difficulty understanding what you want the program to do here. Why do you need to have a movie focussed on a second monitor while working in MyPaint on the first? To my limited understanding too, either the game would be demanding your involvement or mypaint would be. Could you explain the use case a little more?

achadwick commented 9 years ago

Tech note: just a reminder to myself that this may cut across #259.

Also, if we implement this, it's likely to be in the form of a "last device (name) used" or "last core pointer used" flag somewhere, and moving away from using GTK_WIN_POS_MOUSE (a.k.a. Gtk.WindowPosition.MOUSE)

Deferring till after the 1.2 release to allow requirements to be gathered.

amarao commented 9 years ago

Hello.

Thank you for response.

I've tested on the git version (2a10764ad967) and it behaved even more oddly.

When I draw with my primary input device (mouse) it works and 'c'/'b' dialogs appears normally. But when I draw with secondary devices (wacom+separate keyboard) when I press 'c' or 'b' it just blinks dialog under primary pointer (less than 1/10s, sometime even invisibly-fast).

My current xinput configuration:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SIGMACH1P USB Keykoard                    id=9    [slave  pointer  (2)]
⎜   ↳ Genius Optical Mouse                      id=10   [slave  pointer  (2)]
⎜   ↳ USB USB Keyboard                          id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ USB USB Keyboard                          id=11   [slave  keyboard (3)]
⎡ second pointer                            id=16   [master pointer  (17)]
⎜   ↳ Wacom Cintiq 13HD stylus                  id=13   [slave  pointer  (16)]
⎜   ↳ Wacom Cintiq 13HD eraser                  id=14   [slave  pointer  (16)]
⎜   ↳ Wacom Cintiq 13HD pad                     id=15   [slave  pointer  (16)]
⎜   ↳ second XTEST pointer                      id=18   [slave  pointer  (16)]
⎣ second keyboard                           id=17   [master keyboard (16)]
    ↳ SIGMACH1P USB Keykoard                    id=8    [slave  keyboard (17)]
    ↳ second XTEST keyboard                     id=19   [slave  keyboard (17)]
achadwick commented 9 years ago

Great feedback, thanks! That last glitch is certainly worth nailing down before the release.

achadwick commented 9 years ago

Sorry I haven't addressed this yet.

1.2.0 is due soon, and I have to be progressing things. There are already a number of issue piling up for the early phases of 1.2.1 1.3.x development relating to doing true per-device brushes, and taking another look at multi-device use cases. Being less beholden to the system cursor, in other words. It would be good to look at this around then. :smile: