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 751834 - GbViewGrid/GbViewStack: fix moving views
GbViewGrid/GbViewStack: fix moving views
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other All
: Normal trivial
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-02 13:05 UTC by sébastien lafargue
Modified: 2015-07-03 06:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GbViewGrid/GbViewStack: fix moving views (2.65 KB, patch)
2015-07-02 13:05 UTC, sébastien lafargue
none Details | Review
GbViewGrid/GbViewStack: fix moving views (2.60 KB, patch)
2015-07-02 21:31 UTC, sébastien lafargue
committed Details | Review

Description sébastien lafargue 2015-07-02 13:05:10 UTC
We should not re-create views when moving them.
Now, view state is preserved ( scroll position, cursor position,
split state etc... )
Comment 1 sébastien lafargue 2015-07-02 13:05:14 UTC
Created attachment 306615 [details] [review]
GbViewGrid/GbViewStack: fix moving views

We should not re-create views when moving them.
Now, view state is preserved ( scroll position, cursor position,
split state etc... )
Comment 2 Christian Hergert 2015-07-02 19:11:06 UTC
Review of attachment 306615 [details] [review]:

Just a few small things to fix

::: src/views/gb-view-grid.c
@@ -292,1 +293,1 @@
       gb_view_stack_remove (stack, view);

Removing the item could cause the widget to get destroyed. So we need to ref/unref around the remove/add sequence.

@@ -307,1 +310,1 @@
       gb_view_stack_remove (stack, view);

Same here.

::: src/views/gb-view-grid.h
@@ -24,2 +24,3 @@
 #include "gb-document.h"
 #include "gb-view-stack.h"
+#include "gb-view-stack-private.h"

-private.h should only be included from .c files and other -private.h files.
Comment 3 sébastien lafargue 2015-07-02 21:31:30 UTC
Created attachment 306667 [details] [review]
GbViewGrid/GbViewStack: fix moving views