Fix issue where notifications will show as 1 pixel line if primary screen wasn't the leftmost one
AbandonedPublic

Authored by davidedmundson on Aug 2 2017, 11:29 AM.

Details

Reviewers
matank
Group Reviewers
Plasma
Summary

eab4aa9909a62cce9b32555ed28d142569fb467f introduces a bug where
notifications will show up as 1 pixel line if the primary screen is the most left one

The bug is casued by the removal of The following lines :

if (d->mainItem) {
    d->syncToMainItemSize(); // adding back the following lines fixes the issue
}

Adding them back solves the issue

BUG: 382340

Diff Detail

Repository
R242 Plasma Framework (Library)
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
matank created this revision.Aug 2 2017, 11:29 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 2 2017, 11:29 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript

I can't comment too much on the content, but please:

  • shorten the title (it will be the first line of the git commit message)
  • I'm not totally sure if BUG works without : (so BUG: xxxxxx)
broulik edited the summary of this revision. (Show Details)Aug 2 2017, 11:34 AM
broulik added a reviewer: Plasma.
broulik retitled this revision from added back lines to void Dialog::componentComplete() to fix an issue where the notifications will show as 1 pixel line if the primary screen wasn't the most left one. to Fix issue where notifications will show as 1 pixel line if primary screen wasn't the leftmost one.
davidedmundson requested changes to this revision.Aug 2 2017, 1:16 PM
davidedmundson added a subscriber: davidedmundson.

This might well hide the issue, but it can't be "correct".

It's definitely calling updateTheme twice, which is very expensive.
and I'm pretty sure it's syncing twice, (so updating updateTheme 3 times)

But I think you've found a bug, if you can try either of the things I suggest that would be fantastic.

src/plasmaquick/dialog.cpp
1317

So there's a bug if we call setVisible before componentComplete fires?
Weird that that happens with the notification is on a different screen.

We're calling the superclass setVisible method, as an optimisation, but this code is out of sync with the current Dialog::setVisible.

We either need:

to copy         "//setting the main item visible before the show event arrives..." from setVisible to here before this line.

*or*

change this method to be just

{

d->componentComplete  = true;
setVisible(d->visible);  //and call the Dialog implementation which does the rest of this method - but better

}

This revision now requires changes to proceed.Aug 2 2017, 1:16 PM

I've done what I mean here: https://phabricator.kde.org/D7085
Hopefully that will be easier to test.

matank updated this revision to Diff 17609.EditedAug 3 2017, 7:02 AM
matank edited edge metadata.
  • Fix issue where notifications will show as 1 pixel line

I tried what you suggested it didn't solve the issue
it seems the dialog size is not being set correctly and if it being set correctly in componentComplete than the issue goes away
This is still a bit hackish not sure why the dialog size can be set incorrectly in the first place

Also if anyone want to reproduce the issue , it can be done easily by running a virtual machine with 2 screens and setting the primary screen to the right one
than just kill plasmashell and restart it and you should see the bug in the next notification you spawn

Restricted Application added a project: Plasma. · View Herald TranscriptAug 3 2017, 7:02 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

Can you explain the logic behind adding the code you've added.

matank added a comment.Aug 3 2017, 8:56 AM

Calling syncToMainItemSize() in componentComplete() seems to solve the issue , so I checked what is being done in syncToMainItemSize() that affects the issue.
I found that resizing the dialog is what seems to resolve the issue so I copied the relevant code from syncToMainItemSize() to avoid running updateTheme() more than once.

The only issue with what I have done that it seems like dialog size should be set correctly later on as it works without this code if the primary screen is the left most one.

mart added a subscriber: mart.EditedAug 4 2017, 11:29 AM

looking into it, i still think the dialog code is correct.
what happens is that someone external resizes the notification window to 0x0 pixels wide right after the componentcomplete event. if as in this patch the dialog is resized explicitly in componentcomplete, that other spurious resize (from 0x0 to 0x0 btw) doesn't happen anymore

even tough I am still not sure where that resize event comes from (feeling like blaming either windowmanagement tough is weird as is still unmapped or qt xcb), I think a more correct patch, is D7127

I can confrim that mart's patch ( D7127) solves the issue.

davidedmundson commandeered this revision.Aug 9 2017, 7:06 PM
davidedmundson edited reviewers, added: matank; removed: davidedmundson.

I can confrim that mart's patch ( D7127) solves the issue.

I'll close this .

davidedmundson abandoned this revision.Aug 9 2017, 7:06 PM