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 615593 - Control-W should close extra pane
Control-W should close extra pane
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Keyboardability
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-12 22:11 UTC by Holger Berndt
Modified: 2010-04-16 21:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (2.90 KB, patch)
2010-04-13 21:00 UTC, Holger Berndt
none Details | Review
second version of the patch (3.09 KB, patch)
2010-04-15 21:13 UTC, Holger Berndt
needs-work Details | Review

Description Holger Berndt 2010-04-12 22:11:28 UTC
Control-W currently closes the active slot. When the active pane doesn't have any more slots, the window is closed, even if there is another pane with one or even more slots.

Control-W should close the active slot, until there is no slot remaining in the pane. Then it should close the active pane in dual-pane mode, and switch to the other pane. More presses to Control-W close the slots on that pane, until none is left and the window is closed.
Comment 1 Holger Berndt 2010-04-13 21:00:12 UTC
Created attachment 158645 [details] [review]
proposed patch
Comment 2 Holger Berndt 2010-04-15 21:13:57 UTC
Created attachment 158839 [details] [review]
second version of the patch

Don't switch to next pane on closing of the active pane - this is unnecessary on window close. Instead, the caller of _pane_close() must make sure that he sets a new pane after destroying the currently active pane if he wants to keep the window.

Also, changed
 g_list_length(list) == 0
to
 list == NULL
as the micro-optimization of the day.
Comment 3 Alexander Larsson 2010-04-16 14:08:46 UTC
Review of attachment 158839 [details] [review]:

::: src/nautilus-window-pane.c
@@ +152,3 @@
+		if (window->details->active_pane->slots == NULL) {
+			/* ... close pane if multiple panes are open, or close the window otherwise. */
+			if (window->details->panes && window->details->panes->next) {

Its a bit weird that you check this here, its done in nautilus_window_get_next_pane too.

@@ +156,3 @@
+				next_pane = nautilus_window_get_next_pane (NAUTILUS_WINDOW (window));
+				nautilus_window_close_pane (pane);
+				if (next_pane) {

With the above check this should always be true, and if it isn't for some reason then we'll get in a weird state, with no next pane but not closing the window.

Basically, we should just always call get_next_pane, and if it fails, close the window instead of doing the checks above ourselves.
Comment 4 Alexander Larsson 2010-04-16 18:32:38 UTC
With that, suitably tested you can commit this.
Comment 5 Holger Berndt 2010-04-16 21:26:08 UTC
Pushed to master. Thanks for reviewing.