Bug 364237 - When user switches to a subwindow of other saved document , the window reverts to previous subwindow
Summary: When user switches to a subwindow of other saved document , the window revert...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-12 12:42 UTC by Raghavendra kamath
Modified: 2023-06-06 12:11 UTC (History)
7 users (show)

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


Attachments
demo showing the bug (586.42 KB, video/mp4)
2016-06-12 12:43 UTC, Raghavendra kamath
Details
(Video example) (1.22 MB, video/mp4)
2016-12-30 10:47 UTC, mvowada
Details
Proposed patch 001 for 364237 (541 bytes, patch)
2017-03-22 11:26 UTC, Bruno P. Kinoshita
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raghavendra kamath 2016-06-12 12:42:01 UTC
When a user switches between two document ( must be saved documents) with a pen by clicking on the window menu and name off the document. the subwindow reverts to previous subwindow after may be 1/2 a second. This happens with mouse too but it takes longer to switch back

Reproducible: Always

Steps to Reproduce:
1.open two saved documents in krita
2.by using the pen try to switch to other document
3.don't do anything after the switch and notice

Actual Results:  
the newly switched subwindow is reverted to previous window

Expected Results:  
the switched window must be shown and window shouldn't revert back to previous one
Comment 1 Raghavendra kamath 2016-06-12 12:43:07 UTC
Created attachment 99470 [details]
demo showing the bug

Attached is a video showing the bug
Comment 2 Quiralta 2016-06-23 17:11:06 UTC
I can reproduce the same issue, also on archlinux.
Comment 3 Halla Rempt 2016-10-29 15:10:34 UTC
Didn't we determine that this was a Qt 5.7 bug?
Comment 4 Raghavendra kamath 2016-12-07 14:44:27 UTC
This happens with krita-3.0.93-x86_64.appimage too which I think has older version of qt. boud said that it has qt 5.6 on IRC. so i guess this can be triggered with qt 5.6 and 5.7 too
Comment 5 Halla Rempt 2016-12-07 14:45:59 UTC
Bugzilla wants a comment when I change the status.
Comment 6 mvowada 2016-12-30 10:47:07 UTC
Created attachment 103089 [details]
(Video example)

In my case, I can actually stay on the window I've switched to, on condition that I do NOT move the cursor over the canvas (Ubuntu 14.04 - Krita 3.1.1)
Comment 7 David REVOY 2017-03-13 23:12:24 UTC
This bug is still reproducible on Krita 3.1.2appimage (Xfce+buntu16.04).
gif anim: http://www.peppercarrot.com/extras/forum/2017-03-14_bug-switching-windows.gif

Also, reported on Reddit here too: https://www.reddit.com/r/krita/comments/5z5tan/having_trouble_using_multiple_documents_in_krita/

Note: to reproduce: the two files must be *.kra , 'tile' subwindows before, then maximise a single subwindow, then switch as on the gif anim.
Comment 8 Andy Statia 2017-03-14 15:52:47 UTC
Issue reproducible on Windows 10 with Krita 3.1.2 under the same conditions.  Two saved documents in full window mode switching via the Windows menu and tapping the document title with the pen.  Duration between switching varies somewhat from 0.5 seconds to a few seconds depending on what one is doing over the document.

Experimented with switching docs, then removing the stylus from the tablet.  This allowed the document change to take effect, but as soon as the stylus returned to the tablet, the documents switched back.  It seems to be the motion of the stylus over the interface after switching documents that induces the switch back.
Comment 9 Bollebib 2017-03-17 13:07:47 UTC
I also get this.
Comment 10 Bruno P. Kinoshita 2017-03-22 11:25:04 UTC
Confirmed in my environment too. Took me a few hours debugging until I found a "solution". Attached a patch that fixes the issue in my environment.

When you click on a tab, then the activeSubWindow is correctly set up and also the another mdiArea->activeSubView(). But when your checkbox is triggered, only the activeSubWindow is being set.
Comment 11 Bruno P. Kinoshita 2017-03-22 11:26:09 UTC
Created attachment 104684 [details]
Proposed patch 001 for 364237

A one-line patch that fixed the issue in my environment. Hope that helps.
Comment 12 Halla Rempt 2017-03-22 12:12:55 UTC
Ha, that looks sensible. Thanks! I'll push it.
Comment 13 Halla Rempt 2017-03-22 12:22:51 UTC
Git commit 8640e92a163bc848e89b164aa2b2d35acb0617f8 by Boudewijn Rempt.
Committed on 22/03/2017 at 12:22.
Pushed by rempt into branch 'master'.

Patch by Bruno P. Kinoshita. Thanks!

M  +1    -0    libs/ui/KisMainWindow.cpp
M  +1    -1    libs/ui/KisMainWindow.h

https://commits.kde.org/krita/8640e92a163bc848e89b164aa2b2d35acb0617f8
Comment 14 Bruno P. Kinoshita 2017-03-24 07:39:53 UTC
Thanks!
Comment 15 Dmitry Kazakov 2023-06-06 12:11:56 UTC
Git commit 5f8ebb64522169a5cb0d9a5f56a6742cbba05ea7 by Dmitry Kazakov.
Committed on 06/06/2023 at 12:11.
Pushed by dkazakov into branch 'master'.

Fix double switch of the view in KisViewManager

The view is switched twice, once in d->mdiArea->setActiveSubWindow(subwin)
and once in setActiveView(view).

M  +0    -1    libs/ui/KisMainWindow.cpp

https://invent.kde.org/graphics/krita/-/commit/5f8ebb64522169a5cb0d9a5f56a6742cbba05ea7