After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764060 - opening a second nautilus while a delete operation is in progress results in a broken window
opening a second nautilus while a delete operation is in progress results in ...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkPopover
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 764782 765067 767544 768313 768328 769321 769547 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-03-23 08:51 UTC by Hussam Al-Tayeb
Modified: 2016-08-05 12:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot showing bug. (1.32 MB, image/png)
2016-03-23 08:51 UTC, Hussam Al-Tayeb
  Details
Button persist bug (138.64 KB, image/png)
2016-04-10 07:25 UTC, Neil Herald
  Details
toolbar: fix broken operations popover when new windows are opened (3.84 KB, patch)
2016-04-13 21:16 UTC, Neil Herald
none Details | Review
toolbar: fix broken operations popover when new windows are opened (3.68 KB, patch)
2016-04-14 06:07 UTC, Neil Herald
reviewed Details | Review
GtkWindow: Ensure the toplevel is realized before realizing popovers (994 bytes, patch)
2016-04-14 09:39 UTC, Carlos Garnacho
committed Details | Review

Description Hussam Al-Tayeb 2016-03-23 08:51:19 UTC
Created attachment 324577 [details]
screenshot showing bug.

opening a second nautilus while a delete operation is in progress results in a broken window and then both windows poof when the delete operation is over.
I will attach a screenshot.
Comment 1 Carlos Soriano 2016-03-23 08:54:09 UTC
For newcomers, this is a nice bug to fix once you have 1 or 2 fixed.

I believe this happens because we show the popover when it is not attached to the button. So needs to investigate when the popover is shown, and make sure the toolbar and the button are constructed already.
Comment 2 Hussam Al-Tayeb 2016-03-29 07:27:47 UTC
This also happens if I already have two nautilus windows open before the copy/delete operation. In this case, the file operation indicator in nautilus won't disappear on its own even till one nautilus window is closed which is somewhat messy.
Comment 3 Neil Herald 2016-04-04 11:25:55 UTC
I'll have a go at fixing this one. Will hold off writing any code until my other change has been reviewed
Comment 4 Carlos Soriano 2016-04-05 08:43:20 UTC
(In reply to Neil Herald from comment #3)
> I'll have a go at fixing this one. Will hold off writing any code until my
> other change has been reviewed

I cannot see any change or patch in this bug report.
What do you mean exactly?
Comment 5 Neil Herald 2016-04-05 17:44:01 UTC
I haven't made any changes yet. I'll fix this next, but I won't make any code changes until my change for 747907 has been reviewed. Just want to make sure I'm on the right lines before I write more code.
Comment 6 Carlos Soriano 2016-04-06 07:24:57 UTC
(In reply to Neil Herald from comment #5)
> I haven't made any changes yet. I'll fix this next, but I won't make any
> code changes until my change for 747907 has been reviewed. Just want to make
> sure I'm on the right lines before I write more code.

Ah! There is not need to hold it back, just go ahead please :)
Each patch has nothing to do with each other and can be reviewed independently.
Also seems Bastien reviewed your patch, so you can have some feedback.
Comment 7 Neil Herald 2016-04-08 22:27:48 UTC
You're right - the window pointer of operations_popover is NULL, when it's created for the second window. 

When the second window is opened, it opens the popover. Is this the desired behaviour though? If the user has started an operation (e.g. a delete) in one window, and the popover has already appeared, I don't think they would want to see the popover appear again for the second window. They would already know that the delete is happening because they got the popover in the first window. 

If the popover shouldn't be shown automatically in the second window, that's an easy change (I have a fix ready for that). Otherwise I can look into fixing it so it opens automatically for the second window (and any other subsequent windows).
Comment 8 Hussam Al-Tayeb 2016-04-08 23:12:48 UTC
(In reply to Neil Herald from comment #7)
> You're right - the window pointer of operations_popover is NULL, when it's
> created for the second window. 
> 
> When the second window is opened, it opens the popover. Is this the desired
> behaviour though? If the user has started an operation (e.g. a delete) in
> one window, and the popover has already appeared, I don't think they would
> want to see the popover appear again for the second window. They would
> already know that the delete is happening because they got the popover in
> the first window. 
> 
> If the popover shouldn't be shown automatically in the second window, that's
> an easy change (I have a fix ready for that). Otherwise I can look into
> fixing it so it opens automatically for the second window (and any other
> subsequent windows).

The popover also doesn't disappear on its own if here are two nautilus windows open. I waited 30 minutes after the file operation was completed...
It only behaves correctly when there is one nautilus window only.
Comment 9 Neil Herald 2016-04-10 07:25:44 UTC
Created attachment 325649 [details]
Button persist bug
Comment 10 Neil Herald 2016-04-10 07:45:48 UTC
I spotted that too. There's also another similar bug where the toolbar button doesn't disappear (see screenshot) in the other windows. When there are two windows, the popover appears on both. You need to close both popovers (by bringing each window in focus, in turn), then the button will stay in the toolbar for the window you brought into focus first. 

I'm planning on making the following changes: 
* Change it so that the popover only automatically appears in the active window (the window that triggered it). I don't think it makes sense to have it appear in more than one window - as I explained before
* If the toolbar button in the other windows still doesn't disappear as it should, I'll raise a separate bug for that

If anyone disagrees with these changes, please let me know. The other thing we could do is close the popover if the window loses focus. That way, only one window can ever have a popover open, and would alleviate some of the issues (and probably be a better for the user).
Comment 11 Hussam Al-Tayeb 2016-04-10 15:29:09 UTC
(In reply to Neil Herald from comment #10)

> I'm planning on making the following changes: 
> * Change it so that the popover only automatically appears in the active
> window (the window that triggered it). I don't think it makes sense to have
> it appear in more than one window - as I explained before
This makes sense.

> If anyone disagrees with these changes, please let me know. The other thing
> we could do is close the popover if the window loses focus. That way, only
> one window can ever have a popover open, and would alleviate some of the
> issues (and probably be a better for the user).
You mean move the popover dynamically back and forth between focused windows?
That would work too. Would the popover also automatically move to the unfocused nautilus window if the focused one is closed?

(In reply to Neil Herald from comment #9)
> Created attachment 325649 [details]
> Button persist bug
Yes, I see this one too. This happens if one window is closed but the other is still there and the file operation ended a long time ago.
Comment 12 Neil Herald 2016-04-10 18:28:33 UTC
(In reply to Hussam Al-Tayeb from comment #11)
> You mean move the popover dynamically back and forth between focused windows?
> That would work too. Would the popover also automatically move to the
> unfocused nautilus window if the focused one is closed?
I hadn't actually thought of showing it on the newly focused window, I think it's a nice idea (although probably not the easiest thing to implement). My suggestion was purely to close the popover if the window lost focus. I tried this out and it works OK, but would be interested to see what others think - I'm new to the project and don't know what design decisions went into it.
Comment 13 Carlos Soriano 2016-04-11 12:05:29 UTC
(In reply to Neil Herald from comment #7)
> You're right - the window pointer of operations_popover is NULL, when it's
> created for the second window. 
> 
> When the second window is opened, it opens the popover. Is this the desired
> behaviour though? If the user has started an operation (e.g. a delete) in
> one window, and the popover has already appeared, I don't think they would
> want to see the popover appear again for the second window. They would
> already know that the delete is happening because they got the popover in
> the first window. 
> 

The popover is not "only" to inform the user that a operation is going on, but to see the progress. So I believe the user would want to see it in the new window.
Comment 14 Carlos Soriano 2016-04-11 12:05:53 UTC
(In reply to Neil Herald from comment #9)
> Created attachment 325649 [details]
> Button persist bug

That should be fixed in 3.20, is not?
Comment 15 Carlos Soriano 2016-04-11 12:10:00 UTC
(In reply to Neil Herald from comment #10)
> I spotted that too. There's also another similar bug where the toolbar
> button doesn't disappear (see screenshot) in the other windows. When there
> are two windows, the popover appears on both. You need to close both
> popovers (by bringing each window in focus, in turn), then the button will
> stay in the toolbar for the window you brought into focus first. 
> 

It's not a bug, it's intended.
We can discuss better approaches to it though.

> I'm planning on making the following changes: 
> * Change it so that the popover only automatically appears in the active
> window (the window that triggered it). I don't think it makes sense to have
> it appear in more than one window - as I explained before

Makes sense I think.

> * If the toolbar button in the other windows still doesn't disappear as it
> should, I'll raise a separate bug for that
> 

Yeah, I think that's a separate issue to discuss.

> If anyone disagrees with these changes, please let me know. The other thing
> we could do is close the popover if the window loses focus. That way, only
> one window can ever have a popover open, and would alleviate some of the
> issues (and probably be a better for the user).

I'm not sure. If the user opened the popover, why should we close it to it?
Or do you mean only in the case where we show the popover because a operation started?
Comment 16 Neil Herald 2016-04-11 12:13:11 UTC
(In reply to Carlos Soriano from comment #14)
> (In reply to Neil Herald from comment #9)
> > Created attachment 325649 [details]
> > Button persist bug
> 
> That should be fixed in 3.20, is not?

I'm on the nautilus master branch, unless that doesn't have the 3.20 changes in?
Comment 17 Hussam Al-Tayeb 2016-04-11 12:27:36 UTC
(In reply to Carlos Soriano from comment #14)
> (In reply to Neil Herald from comment #9)
> > Created attachment 325649 [details]
> > Button persist bug
> 
> That should be fixed in 3.20, is not?

It's not fixed. I still see it in 3.20 release.
Comment 18 Neil Herald 2016-04-11 12:31:55 UTC
(In reply to Carlos Soriano from comment #15)
> (In reply to Neil Herald from comment #10)
> > ... button doesn't disappear in the other windows ...
> > 
> 
> It's not a bug, it's intended.
> We can discuss better approaches to it though.
It just seems strange that it disappears in one of the windows (about a few seconds after the last operation has finished - which is what I'd expect), but it never goes away from the second one. And also the fact it brings up an empty popover. Anyway let's leave the discussion on that to another thread!


> > The other thing we could do is close the popover if the window 
> > loses focus
> 
> I'm not sure. If the user opened the popover, why should we close it to it?
> Or do you mean only in the case where we show the popover because a
> operation started?
I was thinking of doing it for all cases. I'll leave that change out, I wasn't so sure on it after I'd tried it out - for the reason you pointed out. Although, the popover closes when you click elsewhere on the same window (I think, although that's maybe only when you click the toolbar).
Comment 19 Hussam Al-Tayeb 2016-04-11 12:54:35 UTC
An empty popover definitely looks like a bug.
How about show the popover in all windows but also populate it with file operation progress started newly from other windows as well.
If a new nautilus window appears, also add a popover with current progress operations.
Then when the last operation is finished, remove the popovers from all windows.
Sounds like a clean approach? For me, this would be the least confusing.
Comment 20 Neil Herald 2016-04-12 05:57:32 UTC
(In reply to Hussam Al-Tayeb from comment #19)
> An empty popover definitely looks like a bug.
> How about show the popover in all windows but also populate it with file
> operation progress started newly from other windows as well.
> If a new nautilus window appears, also add a popover with current progress
> operations.
> Then when the last operation is finished, remove the popovers from all
> windows.
That's pretty much how it should work. And the list is shared between all windows, so if you start a new operation from another window, it'll be added to the list.
Comment 21 Carlos Soriano 2016-04-12 08:22:58 UTC
(In reply to Hussam Al-Tayeb from comment #17)
> (In reply to Carlos Soriano from comment #14)
> > (In reply to Neil Herald from comment #9)
> > > Created attachment 325649 [details]
> > > Button persist bug
> > 
> > That should be fixed in 3.20, is not?
> 
> It's not fixed. I still see it in 3.20 release.

:(
Comment 22 Carlos Soriano 2016-04-12 08:27:21 UTC
(In reply to Neil Herald from comment #18)
> (In reply to Carlos Soriano from comment #15)
> > (In reply to Neil Herald from comment #10)
> > > ... button doesn't disappear in the other windows ...
> > > 
> > 
> > It's not a bug, it's intended.
> > We can discuss better approaches to it though.
> It just seems strange that it disappears in one of the windows (about a few
> seconds after the last operation has finished - which is what I'd expect),
> but it never goes away from the second one. And also the fact it brings up
> an empty popover. Anyway let's leave the discussion on that to another
> thread!
> 

Indeed, that shouldn't happen. Intended behavior is to only remove the button when all windows have the popover closed (there is a code not so beautiful in nautilus-toolbar for that).
> 
> > > The other thing we could do is close the popover if the window 
> > > loses focus
> > 
> > I'm not sure. If the user opened the popover, why should we close it to it?
> > Or do you mean only in the case where we show the popover because a
> > operation started?
> I was thinking of doing it for all cases. I'll leave that change out, I
> wasn't so sure on it after I'd tried it out - for the reason you pointed
> out. Although, the popover closes when you click elsewhere on the same
> window (I think, although that's maybe only when you click the toolbar).

Right, losing focus it's pretty close to "clicking anywhere else". If the change makes sense to you and the code doesn't look ugly... why not.
However, my main concern about "automatic" actions is that usually bring more problems than solutions. In this case I can imagine this: you open the popover to see the finished operation, then you change the window to check something, and then the popover dissapear, and not only that, the button dissapear too losing the ability to check it again. Then the user is angry :)
Comment 23 Bastien Nocera 2016-04-12 13:45:28 UTC
*** Bug 764782 has been marked as a duplicate of this bug. ***
Comment 24 Neil Herald 2016-04-13 21:16:40 UTC
Created attachment 325885 [details] [review]
toolbar: fix broken operations popover when new windows are opened

Opening another Nautilus window while a file operation is in progress causes
the the operations popover to open in a broken state. The associated window
isn't realised at the time the popover is first shown, meaning that the popover
gets it's own window/title bar, which looks odd and doesn't work like it
should.

This fix is to delay the initialisation of the operations popover and button
until the toolbar (and therefore the window) has been realised. As a
belt-and-braces change, also add a check to the update_operations to prevent it
opening the popover if the window isn't yet realised.
Comment 25 Neil Herald 2016-04-13 21:27:59 UTC
(In reply to Carlos Soriano from comment #22)
> something, and then the popover dissapear, and not only that, the button
> dissapear too losing the ability to check it again. Then the user is angry :)
Completely agree. BTW, I wasn't talking about removing/hiding the button in any of the proposed changes - the behaviour or that would be unchanged. 

The patch I've just submitted is purely to fix the bug. I'll submit a separate patch to change the popover to open automatically only in the active window. It's a one-liner, but want to test it a bit more.
Comment 26 Hussam Al-Tayeb 2016-04-13 21:54:17 UTC
(In reply to Neil Herald from comment #24)
> Created attachment 325885 [details] [review] [review]
> toolbar: fix broken operations popover when new windows are opened
> 
> Opening another Nautilus window while a file operation is in progress causes
> the the operations popover to open in a broken state. The associated window
> isn't realised at the time the popover is first shown, meaning that the
> popover
> gets it's own window/title bar, which looks odd and doesn't work like it
> should.
> 
> This fix is to delay the initialisation of the operations popover and button
> until the toolbar (and therefore the window) has been realised. As a
> belt-and-braces change, also add a check to the update_operations to prevent
> it
> opening the popover if the window isn't yet realised.

Ok, I tried the patch. opening a new window while a file operation is in progress results in a new working window and the popover disappears from both windows after the file operation is over.
Comment 27 Hussam Al-Tayeb 2016-04-13 22:54:49 UTC
(In reply to Neil Herald from comment #25)
> The patch I've just submitted is purely to fix the bug. I'll submit a
> separate patch to change the popover to open automatically only in the
> active window. It's a one-liner, but want to test it a bit more.

How would that work? What would happen if I close the active window? Will the popup move to the second nautilus window or will the file operation be interrupted?
Comment 28 Neil Herald 2016-04-14 06:07:57 UTC
Created attachment 325894 [details] [review]
toolbar: fix broken operations popover when new windows are opened

Opening another Nautilus window while a file operation is in progress
causes the the operations popover to open in a broken state. It gets
it's own window/title bar, which looks odd and doesn't work correctly.

This fix delays the initialisation of the operations popover and button
until the UI elements have been realised. Also add a check to
update_operations to prevent it opening the popover if the window hasn't
been realised.
Comment 29 Neil Herald 2016-04-14 06:09:20 UTC
I've re-attached that patch - the commit message of my earlier one wasn't formatted correctly. Please ignore the earlier one
Comment 30 Neil Herald 2016-04-14 06:14:34 UTC
(In reply to Hussam Al-Tayeb from comment #26)
> Ok, I tried the patch. opening a new window while a file operation is in
> progress results in a new working window and the popover disappears from
> both windows after the file operation is over.
Thanks for checking it.

(In reply to Hussam Al-Tayeb from comment #27)
> How would that work? What would happen if I close the active window? Will
> the popup move to the second nautilus window or will the file operation be
> interrupted?
The popovers don't work like that. Regardless of which window you look at the popover, you'll see the same list - which is why I think it's redundant that it gets opened automatically in every window. If you close one of the windows, the operation will still run in the background and be shown in the list of the other windows. I'll submit the patch tonight, if you don't think it's right we can just leave it.
Comment 31 Carlos Soriano 2016-04-14 08:25:12 UTC
Review of attachment 325894 [details] [review]:

Thanks for digging into it!

The patch makes me think it's a gtk+ issue then... imho we shouldn't need to check the window state to set the widgets visible or not, or the buttons active or not.
I will check with gtk+ developers.
Comment 32 Carlos Soriano 2016-04-14 08:32:53 UTC
As discussed with Carlos Garnacho, this seems to be a gtk+ issue. Reassigning.
Comment 33 Carlos Garnacho 2016-04-14 09:39:49 UTC
Fixed now in gtk+ master.

The following fix has been pushed:
46cdb44 GtkWindow: Ensure the toplevel is realized before realizing popovers
Comment 34 Carlos Garnacho 2016-04-14 09:39:55 UTC
Created attachment 325987 [details] [review]
GtkWindow: Ensure the toplevel is realized before realizing popovers

Otherwise those get a NULL parent window, which is toplevel-y enough
to disembody the popover.
Comment 35 Carlos Soriano 2016-04-14 09:49:26 UTC
Can we have it on 3.20 too? thanks
Comment 36 Hussam Al-Tayeb 2016-05-06 02:01:21 UTC
It would be nice to have this in 3.20 as well so I don't have to remember to apply the patch when I do builds from gtk-3-20 branch ;)
Comment 37 Ernestas Kulik 2016-06-12 07:31:46 UTC
*** Bug 767544 has been marked as a duplicate of this bug. ***
Comment 38 Ernestas Kulik 2016-07-02 13:07:23 UTC
*** Bug 768313 has been marked as a duplicate of this bug. ***
Comment 39 Ernestas Kulik 2016-07-02 13:07:30 UTC
*** Bug 765067 has been marked as a duplicate of this bug. ***
Comment 40 Ernestas Kulik 2016-07-03 10:58:53 UTC
*** Bug 768328 has been marked as a duplicate of this bug. ***
Comment 41 Ernestas Kulik 2016-07-30 07:19:08 UTC
*** Bug 769321 has been marked as a duplicate of this bug. ***
Comment 42 Carlos Soriano 2016-08-05 12:57:25 UTC
*** Bug 769547 has been marked as a duplicate of this bug. ***