Discussion:
[zathura] [PATCH] Fix zathura's odd window size issues in GTK3
Abdó Roig-Maranges
2013-07-07 15:21:39 UTC
Permalink
Hi again,

I think I've been able to fix the odd "huge-window" issue with GTK3. I attach a
patch.

Girara was hiding the scrollbars by setting GTK_POLICY_NEVER. It seems that, in
GTK3, the ScrolledWindow container thinks that in such case he must fit the
children size. I have fixed it by always setting GTK_POLICY_AUTOMATIC (which
leads to the desired behaviour), and hiding the scrollbars via
gtk_widget_set_visible when necessary.

However, for some reason that eludes me, this does not work in GTK2, so I kept
two separate versions of it. Maybe somene else will be able to fix this
uniformly in GTK2 and GTK3.

Abd? Roig.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: girara-scrolls-gtk3.patch
Type: text/x-diff
Size: 5553 bytes
Desc: fix scrollbar issues in gtk3
URL: <http://lists.pwmt.org/archive/zathura/attachments/20130707/73fde78e/attachment.patch>
Sebastian Ramacher
2013-07-07 15:45:56 UTC
Permalink
Hi Abd?,
Post by Abdó Roig-Maranges
I think I've been able to fix the odd "huge-window" issue with GTK3. I attach a
patch.
Girara was hiding the scrollbars by setting GTK_POLICY_NEVER. It seems that, in
GTK3, the ScrolledWindow container thinks that in such case he must fit the
children size. I have fixed it by always setting GTK_POLICY_AUTOMATIC (which
leads to the desired behaviour), and hiding the scrollbars via
gtk_widget_set_visible when necessary.
However, for some reason that eludes me, this does not work in GTK2, so I kept
two separate versions of it. Maybe somene else will be able to fix this
uniformly in GTK2 and GTK3.
Thank you so much for this patch. This is awesome!

Regards
--
Sebastian Ramacher
Marwan Tanager
2013-07-07 15:58:36 UTC
Permalink
Post by Abdó Roig-Maranges
Hi again,
I think I've been able to fix the odd "huge-window" issue with GTK3. I attach a
patch.
Girara was hiding the scrollbars by setting GTK_POLICY_NEVER. It seems that, in
GTK3, the ScrolledWindow container thinks that in such case he must fit the
children size. I have fixed it by always setting GTK_POLICY_AUTOMATIC (which
leads to the desired behaviour), and hiding the scrollbars via
gtk_widget_set_visible when necessary.
However, for some reason that eludes me, this does not work in GTK2, so I kept
two separate versions of it. Maybe somene else will be able to fix this
uniformly in GTK2 and GTK3.
Hi Abd?,

Your changes broke commit 47830790a414720b77798e3af62350b8dbf677bc on girara
develop branch, which I've added a while ago to enable showing/hiding the
horizontal/vertical scrollbars independently from each others, while making the
show-scrollbars setting sensitive to this (will be set to true if both
scrollbars are shown, and vice verse).

With your patch, and when both scrollbars are visible, hiding the horizontal
scrollbar causes the vertical scrollbar to be hidden, and vice verse.

I don't know where the problem is exactly (just had a quick look at the patch),
but I thought you'd be better informed of this.

BTW, thanks for adding the comment warning about the possible subtle
recursion. I remember it was a really tricky part when I implemented the noted
patch.


--
Marwan
Abdó Roig-Maranges
2013-07-07 16:08:05 UTC
Permalink
Post by Marwan Tanager
Your changes broke commit 47830790a414720b77798e3af62350b8dbf677bc on girara
develop branch, which I've added a while ago to enable showing/hiding the
horizontal/vertical scrollbars independently from each others, while making the
show-scrollbars setting sensitive to this (will be set to true if both
scrollbars are shown, and vice verse).
Oops, sorry about that. Here is a fix.

Abd?.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: girara-fix-scrollbar-hiding.patch
Type: text/x-diff
Size: 795 bytes
Desc: fix independent scrollbar hiding
URL: <http://lists.pwmt.org/archive/zathura/attachments/20130707/b45e8294/attachment.patch>
Marwan Tanager
2013-07-07 16:17:54 UTC
Permalink
Post by Abdó Roig-Maranges
Post by Marwan Tanager
Your changes broke commit 47830790a414720b77798e3af62350b8dbf677bc on girara
develop branch, which I've added a while ago to enable showing/hiding the
horizontal/vertical scrollbars independently from each others, while making the
show-scrollbars setting sensitive to this (will be set to true if both
scrollbars are shown, and vice verse).
Oops, sorry about that. Here is a fix.
Nice!


--
Marwan

Sebastian Ramacher
2013-07-07 16:09:30 UTC
Permalink
Post by Sebastian Ramacher
Post by Abdó Roig-Maranges
Hi again,
I think I've been able to fix the odd "huge-window" issue with GTK3. I attach a
patch.
Girara was hiding the scrollbars by setting GTK_POLICY_NEVER. It seems that, in
GTK3, the ScrolledWindow container thinks that in such case he must fit the
children size. I have fixed it by always setting GTK_POLICY_AUTOMATIC (which
leads to the desired behaviour), and hiding the scrollbars via
gtk_widget_set_visible when necessary.
However, for some reason that eludes me, this does not work in GTK2, so I kept
two separate versions of it. Maybe somene else will be able to fix this
uniformly in GTK2 and GTK3.
Hi Abd?,
Your changes broke commit 47830790a414720b77798e3af62350b8dbf677bc on girara
develop branch, which I've added a while ago to enable showing/hiding the
horizontal/vertical scrollbars independently from each others, while making the
show-scrollbars setting sensitive to this (will be set to true if both
scrollbars are shown, and vice verse).
With your patch, and when both scrollbars are visible, hiding the horizontal
scrollbar causes the vertical scrollbar to be hidden, and vice verse.
I don't know where the problem is exactly (just had a quick look at the patch),
but I thought you'd be better informed of this.
BTW, thanks for adding the comment warning about the possible subtle
recursion. I remember it was a really tricky part when I implemented the noted
patch.
I guess it's just me forgeting to commit the changes on top of it.

Regards
--
Sebastian Ramacher
Marwan Tanager
2013-07-07 16:17:21 UTC
Permalink
Post by Sebastian Ramacher
Post by Sebastian Ramacher
Post by Abdó Roig-Maranges
Hi again,
I think I've been able to fix the odd "huge-window" issue with GTK3. I attach a
patch.
Girara was hiding the scrollbars by setting GTK_POLICY_NEVER. It seems that, in
GTK3, the ScrolledWindow container thinks that in such case he must fit the
children size. I have fixed it by always setting GTK_POLICY_AUTOMATIC (which
leads to the desired behaviour), and hiding the scrollbars via
gtk_widget_set_visible when necessary.
However, for some reason that eludes me, this does not work in GTK2, so I kept
two separate versions of it. Maybe somene else will be able to fix this
uniformly in GTK2 and GTK3.
Hi Abd?,
Your changes broke commit 47830790a414720b77798e3af62350b8dbf677bc on girara
develop branch, which I've added a while ago to enable showing/hiding the
horizontal/vertical scrollbars independently from each others, while making the
show-scrollbars setting sensitive to this (will be set to true if both
scrollbars are shown, and vice verse).
With your patch, and when both scrollbars are visible, hiding the horizontal
scrollbar causes the vertical scrollbar to be hidden, and vice verse.
I don't know where the problem is exactly (just had a quick look at the patch),
but I thought you'd be better informed of this.
BTW, thanks for adding the comment warning about the possible subtle
recursion. I remember it was a really tricky part when I implemented the noted
patch.
I guess it's just me forgeting to commit the changes on top of it.
No. I've applied the patch separately before pulling from the remote repo.

Anyway, it's fixed now by the second patch Abd? has just sent.


--
Marwan
Loading...