Merge lp:~cimi/overlay-scrollbar/fix-732712 into lp:overlay-scrollbar

Proposed by Andrea Cimitan
Status: Merged
Approved by: Ted Gould
Approved revision: 151
Merged at revision: 151
Proposed branch: lp:~cimi/overlay-scrollbar/fix-732712
Merge into: lp:overlay-scrollbar
Diff against target: 39 lines (+3/-5)
1 file modified
os/os-scrollbar.c (+3/-5)
To merge this branch: bzr merge lp:~cimi/overlay-scrollbar/fix-732712
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+52887@code.launchpad.net

Description of the change

I was storing the position of the window on size_allocate, but on size_allocate the widget could be not realized yet, so its gdk_window not on screen, and so os_scrollbar_store_window_position was storing random values.
Now, everything is done in the realize, so we're sure to get the right position

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'os/os-scrollbar.c'
--- os/os-scrollbar.c 2011-03-09 16:16:12 +0000
+++ os/os-scrollbar.c 2011-03-10 17:23:11 +0000
@@ -496,8 +496,7 @@
496496
497 priv = OS_SCROLLBAR_GET_PRIVATE (scrollbar);497 priv = OS_SCROLLBAR_GET_PRIVATE (scrollbar);
498498
499 if (GDK_IS_WINDOW (gtk_widget_get_window (priv->parent)))499 gdk_window_get_position (gtk_widget_get_window (priv->parent), &win_x, &win_y);
500 gdk_window_get_position (gtk_widget_get_window (priv->parent), &win_x, &win_y);
501500
502 if (priv->orientation == GTK_ORIENTATION_VERTICAL)501 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
503 {502 {
@@ -985,6 +984,8 @@
985 os_scrollbar_calc_layout_pager (scrollbar, priv->adjustment->value);984 os_scrollbar_calc_layout_pager (scrollbar, priv->adjustment->value);
986985
987 os_pager_set_parent (OS_PAGER (priv->pager), priv->parent);986 os_pager_set_parent (OS_PAGER (priv->pager), priv->parent);
987
988 os_scrollbar_store_window_position (scrollbar);
988}989}
989990
990static void991static void
@@ -1025,8 +1026,6 @@
1025 os_scrollbar_calc_layout_pager (scrollbar, priv->adjustment->value);1026 os_scrollbar_calc_layout_pager (scrollbar, priv->adjustment->value);
10261027
1027 pager_set_allocation (scrollbar);1028 pager_set_allocation (scrollbar);
1028
1029 os_scrollbar_store_window_position (scrollbar);
1030}1029}
10311030
1032static void1031static void
@@ -1110,7 +1109,6 @@
1110 os_scrollbar_calc_layout_pager (scrollbar, priv->adjustment->value);1109 os_scrollbar_calc_layout_pager (scrollbar, priv->adjustment->value);
1111 os_scrollbar_calc_layout_slider (scrollbar, priv->adjustment->value);1110 os_scrollbar_calc_layout_slider (scrollbar, priv->adjustment->value);
11121111
1113 /* XXX missing horizontal */
1114 /* proximity area */1112 /* proximity area */
1115 if (priv->orientation == GTK_ORIENTATION_VERTICAL)1113 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
1116 {1114 {

Subscribers

People subscribed via source and target branches