Qownnotes: Reopening QON after closing in maximized distraction-free mode results in mixed state

Created on 24 Nov 2019  路  26Comments  路  Source: pbek/QOwnNotes

Expected behaviour

  • enable 'Distraction free' mode
  • close QON
  • reopen QON
  • enter 'Distraction free' mode

Actual behaviour

  • enable 'Distraction free' mode
  • close QON
  • reopen QON
  • QON is in a mixed state:

    • panels are shows as if QON is in 'normal' mode

    • 'Editor width' is active as if QON is in 'Distraction free' mode

Version: 19.11.20

Low Bug

All 26 comments

How often have I already fixed that Zombie-bug... :laughing:

But I just tried your steps and it worked fine for me on KDE Neon.
Can you please post the output from the debug settings (see issue template).
And can you please explain in step by step what you exactly you did (which buttons you clicked, which shortcuts you used, especially how exactly you did close the application).

And maybe a screenshot how it looked before entering DFM, one how it looked in DFM and one how it looked after open QOwnNotes again.

Hmm I tried to reproduce with a fresh session, but everything works like it should - I can't get it to break when mixing shortcuts/ways of closing QON. Maybe something in my profile, and not worth your time in this case..

I was hoping to get every possible combination of states and settings working. :grin:

It seems to be related to QON being maximized...

Here are 2 screenrecordings (sorry about the flickering - wtf is that anyway).

Here are 2 screenrecordings (sorry about the flickering - wtf is that anyway).

It can happen if you don't use KDE :rofl:

Meanwhile I am able to reproduce it every time.

The main menu disappears, the text edit has huge padding. Looks like this:

image

Happens regardless of whether I use shortcut or menu to switch to the 'Distraction free mode`

It can happen if you don't use KDE

You mean if you DO use KDE...?

It can happen if you don't use KDE

You mean if you DO use KDE...?

I said that about the flickering (as a joke). Apologies if it caused any offense :(

Apologies if it caused any offense :(

Haha no offense at all - I just thought you made a typo (and meant 'happen if you do use KDE') as I am using KDE in the screencast :yum:

I don't get any padding if I leave the DFM after a restart of the application on KDE Neon.

Steps to reproduce from my side:

  • Open QON
  • Press Ctrl+Shift+D (DFM)
  • Close QON while it is in DFM
  • reopen
    DFM mode isn't restored properly.

I have completely reset the app, still the same.

Close QON while it is in DFM

which way to close the app did you use?

which way to close the app did you use?

Just clicking the close button(x) of the window on "top right corner". (Since that's the only button available to close QON in DFM)

I managed to reproduce it.
Key was that the window must be maximized before closing it.

  • maximize application window
  • enter DFM
  • quit (regardless of how)
  • open app again

seems like a side-effect because of the safety measures in conjunction with full-screen mode...

seems like a side-effect because of the safety measures in conjunction with full-screen mode...

https://github.com/pbek/QOwnNotes/blob/8d3074346ff9d5000e0d07a966e4295e574cf122/src/mainwindow.cpp#L391-L393

Yep,
if you increase the delay to 1000, you see the distraction mode get restored for a split second and then all the panels appear

What if we do this instead:

    if (isMaximized() || isFullScreen()) {
        if (isInDistractionFreeMode()) {
             restoreCurrentWorkspace();
        } else {
            QTimer::singleShot(500, this, SLOT(restoreCurrentWorkspace()));
       }
    }

Nice, let's go for it if it works :)

@Waqar144, do you want to make a PR?

@Waqar144, do you want to make a PR?

Yes, i am on it.

And I will revert the previous change from #1458 and ammend it as discussed (if you haven't already)

And I will revert the previous change from #1458 and ammend it as discussed (if you haven't already)

I've done that already, my changes will be committed in the next hours. You only need to change above code.

And I will revert the previous change from #1458 and ammend it as discussed (if you haven't already)

I've done that already, my changes will be committed in the next hours. You only need to change above code.

You were a minute too late :grimacing:

I will revert it again. And do this one only

19.11.22

  • fixed distraction free mode not restored properly on app restart if the app
    previously was maximized (for #1448, thank you @Waqar144)

There now is a new release, could you please test it and report if it works for you?

Working great!馃憤

Great, thank you for testing!

NICE GUYS :+1: :rocket:

Was this page helpful?
0 / 5 - 0 ratings