Merge lp:~larsu/overlay-scrollbar/fix-for-3.10 into lp:overlay-scrollbar

Proposed by Lars Karlitski
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 387
Merged at revision: 381
Proposed branch: lp:~larsu/overlay-scrollbar/fix-for-3.10
Merge into: lp:overlay-scrollbar
Diff against target: 36 lines (+12/-0)
1 file modified
os/os-bar.c (+12/-0)
To merge this branch: bzr merge lp:~larsu/overlay-scrollbar/fix-for-3.10
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Andrea Cimitan Approve
Review via email: mp+196920@code.launchpad.net

Commit message

Create native windows for the scrollbar overlay and tail

As of gtk 3.10, non-native windows are clipped to their widget's allocation. The hijacked scrollbar is given a 0-width or height when horizontal) allocation to make it disappear. Using native windows makes sure that the overlay and tail are drawn regardless.

Description of the change

Create native windows for the scrollbar overlay and tail

As of gtk 3.10, non-native windows are clipped to their widget's allocation. The hijacked scrollbar is given a 0-width or height when horizontal) allocation to make it disappear. Using native windows makes sure that the overlay and tail are drawn regardless.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

That looks fine to me and works fine with gtk 2, gtk 3.8 and gtk 3.10 on trusty. I'm only comment approving though, I would like somebody knowing the codebase a bit better acking the merge (or at least have a second review)

review: Approve
Revision history for this message
Andrea Cimitan (cimi) wrote :

Setting transient window is required at least for gtk2.
If you leave a window unfocused and click on its scrollbar, the window won't get focused without that.

The changes to use parent window kinda worries me for old Gtk too, but so far I didn't find bugs.

I saw you moved some bits in the realize function, but I think you still want to keep the old order... because you need to have events activated before adding the filter or it won't work.

Is setting the user data of the gdkwindow required in gtk2?

review: Needs Fixing
383. By Lars Karlitski

Create windows with the widget's window as parent

Instead of the widget's parent window. This makes the code clearer, but
shouldn't be a functional difference, as scrollbars share a window with their
parent widget.

384. By Lars Karlitski

Only call gdk_window_ensure_native() for gtk3

Also, stop calling gdk_window_set_user_data() for gtk2.

385. By Lars Karlitski

Set overlay windows transient for the scroll bar window again

386. By Lars Karlitski

Don't set window filter func on the parent window

387. By Lars Karlitski

Revert rearranging scrollbar_realize

Revision history for this message
Lars Karlitski (larsu) wrote :

> Setting transient window is required at least for gtk2.
> If you leave a window unfocused and click on its scrollbar, the window won't
> get focused without that.

I've added it back in. The focus issue remains for gtk3 apps, though.

> The changes to use parent window kinda worries me for old Gtk too, but so far
> I didn't find bugs.
>
> I saw you moved some bits in the realize function, but I think you still want
> to keep the old order... because you need to have events activated before
> adding the filter or it won't work.

Sorry, they were from a previous refactor. I've reverted that.

> Is setting the user data of the gdkwindow required in gtk2?

It should be, but it wasn't before. This is unrelated to this patch and since it works without, let's not mingle the two.

Revision history for this message
Andrea Cimitan (cimi) wrote :

> > Setting transient window is required at least for gtk2.
> > If you leave a window unfocused and click on its scrollbar, the window won't
> > get focused without that.
>
> I've added it back in. The focus issue remains for gtk3 apps, though.
>
>
> > The changes to use parent window kinda worries me for old Gtk too, but so
> far
> > I didn't find bugs.
> >
> > I saw you moved some bits in the realize function, but I think you still
> want
> > to keep the old order... because you need to have events activated before
> > adding the filter or it won't work.
>
> Sorry, they were from a previous refactor. I've reverted that.
>
>
> > Is setting the user data of the gdkwindow required in gtk2?
>
> It should be, but it wasn't before. This is unrelated to this patch and since
> it works without, let's not mingle the two.

Thanks, let's approve one change at a time, this code is complex and might be easy to add regressions without realising :)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Works fine, tested on trusty with gtk2 (xchat), gtk3 3.8.7 and 3.10.5

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'os/os-bar.c'
2--- os/os-bar.c 2013-07-17 13:43:37 +0000
3+++ os/os-bar.c 2013-11-29 13:57:08 +0000
4@@ -715,6 +715,11 @@
5 GDK_WA_VISUAL | GDK_WA_COLORMAP);
6 #endif
7
8+#ifdef USE_GTK3
9+ gdk_window_ensure_native (priv->tail_window);
10+ gtk_widget_register_window (priv->parent, priv->tail_window);
11+#endif
12+
13 g_object_ref_sink (priv->tail_window);
14
15 gdk_window_set_transient_for (priv->tail_window,
16@@ -738,6 +743,11 @@
17 GDK_WA_VISUAL | GDK_WA_COLORMAP);
18 #endif
19
20+#ifdef USE_GTK3
21+ gdk_window_ensure_native (priv->bar_window);
22+ gtk_widget_register_window (priv->parent, priv->bar_window);
23+#endif
24+
25 g_object_ref_sink (priv->bar_window);
26
27 gdk_window_set_transient_for (priv->bar_window,
28@@ -751,6 +761,8 @@
29 gdk_region_new (),
30 #endif
31 0, 0);
32+
33+ mask_tail (bar);
34 }
35
36 /**

Subscribers

People subscribed via source and target branches