Bug 285804 - Dual Screen Nvidia Twinview : Krita don't open on the good display
Summary: Dual Screen Nvidia Twinview : Krita don't open on the good display
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-05 10:08 UTC by David REVOY
Modified: 2011-12-27 10:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
storyboard of the bug , in screenshot (99.59 KB, image/jpeg)
2011-11-05 10:08 UTC, David REVOY
Details
patch to show extra debug info (2.11 KB, patch)
2011-12-26 13:20 UTC, Halla Rempt
Details
Deevad's krita.rc file ; 26dec2011 (6.84 KB, application/octet-stream)
2011-12-26 13:59 UTC, David REVOY
Details
new geometry patch. (2.56 KB, patch)
2011-12-26 14:09 UTC, Halla Rempt
Details
my Kritarc file - 26dec2011 (14.42 KB, application/octet-stream)
2011-12-26 15:17 UTC, David REVOY
Details
new version, hopefully with a fix (3.13 KB, patch)
2011-12-26 15:40 UTC, Halla Rempt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David REVOY 2011-11-05 10:08:46 UTC
Created attachment 65254 [details]
storyboard of the bug , in screenshot

Version:           svn trunk
OS:                Linux

On my dual screen, each time I open Krita (maximised ) it position on the wrond LCD. 


Reproducible: Always

Steps to Reproduce:
- have a dual monitor / Twinview Nvidia proprietary driver. 
- Open Krita on the other screen than the one with 0x0px coordinate
- Maximise it on this LCD
- Close it
- Reopen

Actual Results:  
- splash appear on the last monitor where Krita were in use (ok)
- Maximised windows appear behind the splash screen, on correct monitor ( ok)
- When Krita is ready, the main windows 'jump' to my other monitor. ( not ok )
(watch the picture storyboard in attachement )

Expected Results:  
Krita open on the last LCD in use

Workaround : not use a maximised windows , but a reduced windows enlarged to fit the screen ; Krita will open with the main windows reduced to fit the other LCD size. 
( exemple : on my 1600x1200 display ; Krita will open reduced to fit inside 1680x1050 of my other display , so in result ; Krita main windows is 1600x1050 on my 1600x1200 display ; but easier to resize a bit the bottom of the main windows each time, than to grab the maximised windows from one LCD to another )
Comment 1 Halla Rempt 2011-12-26 12:02:09 UTC
Hi Deevad,

Can you check what happens if you make krita startup with the template selection screen by default again? (start krita, press ctrl-n to get the template selection screen again, then uncheck your default template). I need to know whether it's showing the krita canvas or the step before that that's causing the issue.
Comment 2 David REVOY 2011-12-26 12:41:07 UTC
I think the best way to demo the bug was to do a video of my 2 screens and show behavior of Krita :
http://david.revoy.free.fr/forums/krita/2011-12-26_krita-video-2screen-jumping.mkv
But this might also be a Gnome 2 / Metacity bug with Nvidia driver in Twienview ( it wouldn't be a surprise ) . I will try also with compiz activated after posting this, and with another WM ( Awesome and Fluxbox ). I will report
Comment 3 David REVOY 2011-12-26 13:04:46 UTC
Awesome / Fluxbox / Gnome Compiz force launch Krita on the 'primary' screen device ( the one with the system toolbar ).
This behavior is Ok I guess for most user ( user who want to open it on the second screen will have problem of 'jumping' windows to the n°1 ).
So, I think Gnome ( no effect, metacity ) have a bug with Twinview. 

my 2 early conclusion as tester :
a) Krita force to open on the primary screen device
b) Gnome2(noeffect/metacity) with twinview give bad screen ID. So Krita always force to open on the one believed as primary , but metacity fail to give it the right infos.
Comment 4 Halla Rempt 2011-12-26 13:20:44 UTC
Created attachment 67126 [details]
patch to show extra debug info
Comment 5 Halla Rempt 2011-12-26 13:23:23 UTC
Hi Deevad,

I've attached a patch that shows some extra debug output that might help. Could you apply the patch, recompile and then start krita from a terminal and attach the debug output?


You need to do the following:

* save the patch to your home dir
* go to your calligra source directoy
* execute "git apply ~/geometry_debug.diff"
* go to your build directory
* execute "cd libs/main"
* execute "make install"
* run krita
* afterwards, please go back to your source directory and execute "git reset --hard"
Comment 6 Halla Rempt 2011-12-26 13:26:31 UTC
Could you also attach your krita rc file (.kde/share/config/kritarc)?
Comment 7 David REVOY 2011-12-26 13:58:17 UTC
Thanks Boud for the test. 
I did it and here is what the terminal return : 
http://www.pasteall.org/27674/bash
( I started 3 times Krita )
The new things is the splash screen appearing only on my left screen now, and Krita appear systematically on it.
I join my rc file too.
Comment 8 David REVOY 2011-12-26 13:59:57 UTC
Created attachment 67128 [details]
Deevad's krita.rc file ; 26dec2011

krita.rc file, from /home/deevad/.kde/share/apps/krita/krita.rc on my HD.
Comment 9 Halla Rempt 2011-12-26 14:02:16 UTC
Hm, quite interesting... For posterity, this is the interesting bit:

calling createShellGUI
current screen number 0 number of available screens 2 primary screen 0
current desktop geometry QRect(1680,0 1600x1175)
        virtual desktop size QRect(1680,0 1600x1175)
         and the available geometry on the desktop of the right screen QRect(1680,0 1600x1175)
is initial geometry set? false
going to restore windowsize from the config file. Current geom QRect(0,0 1066x1125)
after restoring windowsize from the config file. Current geom QRect(0,0 1600x1200)
Comment 10 Halla Rempt 2011-12-26 14:03:50 UTC
oh -- and I need the kritarc file, not the krita.rc file -- krita.rc comes from .kde/share/apps/krita, but the one I need is .kde/share/config/kritarc.
Comment 11 Halla Rempt 2011-12-26 14:09:35 UTC
Created attachment 67129 [details]
new geometry patch.

A new patch that shows even more output and tries to figure out how to do the right thing. Could you please try again? Same procedure as before, but if you haven't done "git reset --hard", please do so as the first step.
Comment 12 David REVOY 2011-12-26 15:17:55 UTC
Created attachment 67130 [details]
my Kritarc file - 26dec2011

/home/deevad/.kde/share/config
Comment 13 David REVOY 2011-12-26 15:24:04 UTC
http://www.pasteall.org/27676/bash

With the new patch, Krita show the splash always on my left screen( secondary ) 1680x1050 , then the main windows ( or the 'create new document' ) start in 'full screen' ( maximised , without windows controls on the top , or system task bar ) on the 1600x1200 screen on the right. To restore the windows to a normal windows, I must go to View>Fullscreen Mode, and check the option ( nothing happen ) , then recheck it ( Krita become windowed again ). 
If I close , and relaunch Krita maximise again the main windows.
Comment 14 David REVOY 2011-12-26 15:25:40 UTC
I forgot to mention in my previous message : the application always start on the primary ( right screen 1600x1200 now ) maximised. 
Just the splash pop-up on the secondary.
Comment 15 Halla Rempt 2011-12-26 15:40:01 UTC
I think I got it now. It looks like kde only saves the height/width, not the x/y. Let's try a new version of the patch :-)
Comment 16 Halla Rempt 2011-12-26 15:40:23 UTC
Created attachment 67131 [details]
new version, hopefully with a fix
Comment 17 David REVOY 2011-12-26 16:25:47 UTC
http://www.pasteall.org/27677/bash
Good job ! With your new patch , Krita really remember the screen-position and the windows size exatcly. ( I also tested with deleting kritarc, to be sure to have 'fresh' windows position to test also ). 
:)
Comment 18 Halla Rempt 2011-12-27 10:41:40 UTC
Git commit db9bb3364615406f0e2fd3f00e3b3bb83dc12a2a by Boudewijn Rempt.
Committed on 27/12/2011 at 11:29.
Pushed by rempt into branch 'master'.

Store the x,y position of the window so we can restore the geometry

This solves problems with the initial geometry on Twinview systems where
the coordinates are spread out over all screens.
Related: bug 285804

M  +39   -11   libs/main/KoMainWindow.cpp

http://commits.kde.org/calligra/db9bb3364615406f0e2fd3f00e3b3bb83dc12a2a