Skip to contentSkip to conversation

libglib2: Fix midori save file dialog not being rendered

PATCH New Valentine Barshak 2 participants 6 messages Oct 4, 2012 – Oct 14, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libglib2: Fix midori save file dialog not being rendered

This fixes the following issue, when midori
save file dialog is not rendered:
Neither the dialog nor the main window is redrawn
unless the save file dialog is closed.
The buttons can be blindly clicked though.

This is a known issue, which has been fixed in glib 2.32.2.

Backported from the commit ffb000e37be998df55d446c85edbc440fad06a17
From: Dan Winship <[email protected]>
gmain: block child sources when blocking the parent

When blocking a source that has child sources, we need to consider the children blocked as well. Otherwise they will still trigger repeatedly in an inner loop started from the parent source's callback.

https://bugzilla.gnome.org/show_bug.cgi?id=669260

---
 ...ck-child-sources-when-blocking-the-parent.patch | 100 +++++++++++++++++++++
 1 file changed, 100 insertions(+)
 create mode 100644 package/libglib2/libglib2-gmain-block-child-sources-when-blocking-the-parent.patch
package/libglib2/libglib2-gmain-block-child-sources-when-blocking-the-parent.patch new file +100 -0
new file mode 100644
index 0000000..58671fd
@@ -0,0 +1,100 @@
+This should fix midori save file dialog not being displayed.
+Backported from the following changes:
+
+From ffb000e37be998df55d446c85edbc440fad06a17 Mon Sep 17 00:00:00 2001
+From: Dan Winship <[email protected]>
+Date: Wed, 11 Apr 2012 15:21:17 -0400
+Subject: [PATCH] gmain: block child sources when blocking the parent
+
+When blocking a source that has child sources, we need to consider the
+children blocked as well. Otherwise they will still trigger repeatedly
+in an inner loop started from the parent source's callback.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=669260
+diff -pruN glib-2.30.2.orig/glib/gmain.c glib-2.30.2/glib/gmain.c
+--- glib-2.30.2.orig/glib/gmain.c	2011-11-11 21:56:52.000000000 +0400
++++ glib-2.30.2/glib/gmain.c	2012-09-22 03:41:07.686442208 +0400
+@@ -185,7 +185,8 @@ typedef struct _GSourceCallback GSourceC
+ typedef enum
+ {
+   G_SOURCE_READY = 1 << G_HOOK_FLAG_USER_SHIFT,
+-  G_SOURCE_CAN_RECURSE = 1 << (G_HOOK_FLAG_USER_SHIFT + 1)
++  G_SOURCE_CAN_RECURSE = 1 << (G_HOOK_FLAG_USER_SHIFT + 1),
++  G_SOURCE_BLOCKED = 1 << (G_HOOK_FLAG_USER_SHIFT + 2)
+ } GSourceFlags;
+ 
+ #ifdef G_THREADS_ENABLED
+@@ -323,8 +324,7 @@ struct _GSourcePrivate
+ #endif
+ 
+ #define SOURCE_DESTROYED(source) (((source)->flags & G_HOOK_FLAG_ACTIVE) == 0)
+-#define SOURCE_BLOCKED(source) (((source)->flags & G_HOOK_FLAG_IN_CALL) != 0 && \
+-		                ((source)->flags & G_SOURCE_CAN_RECURSE) == 0)
++#define SOURCE_BLOCKED(source) (((source)->flags & G_SOURCE_BLOCKED) != 0)
+ 
+ #define SOURCE_UNREF(source, context)                       \
+    G_STMT_START {                                           \
+@@ -2352,12 +2352,24 @@ block_source (GSource *source)
+ 
+   g_return_if_fail (!SOURCE_BLOCKED (source));
+ 
++  source->flags |= G_SOURCE_BLOCKED;
++
+   tmp_list = source->poll_fds;
+   while (tmp_list)
+     {
+       g_main_context_remove_poll_unlocked (source->context, tmp_list->data);
+       tmp_list = tmp_list->next;
+     }
++
++  if (source->priv && source->priv->child_sources)
++    {
++      tmp_list = source->priv->child_sources;
++      while (tmp_list)
++	{
++	  block_source (tmp_list->data);
++	  tmp_list = tmp_list->next;
++	}
++    }
+ }
+ 
+ /* HOLDS: source->context's lock */
+@@ -2366,15 +2378,27 @@ unblock_source (GSource *source)
+ {
+   GSList *tmp_list;
+   
+-  g_return_if_fail (!SOURCE_BLOCKED (source)); /* Source already unblocked */
++  g_return_if_fail (SOURCE_BLOCKED (source)); /* Source already unblocked */
+   g_return_if_fail (!SOURCE_DESTROYED (source));
+   
++  source->flags &= ~G_SOURCE_BLOCKED;
++
+   tmp_list = source->poll_fds;
+   while (tmp_list)
+     {
+       g_main_context_add_poll_unlocked (source->context, source->priority, tmp_list->data);
+       tmp_list = tmp_list->next;
+     }
++
++  if (source->priv && source->priv->child_sources)
++    {
++      tmp_list = source->priv->child_sources;
++      while (tmp_list)
++	{
++	  unblock_source (tmp_list->data);
++	  tmp_list = tmp_list->next;
++	}
++    }
+ }
+ 
+ /* HOLDS: context's lock */
+@@ -2453,8 +2477,7 @@ g_main_dispatch (GMainContext *context)
+ 	  if (!was_in_call)
+ 	    source->flags &= ~G_HOOK_FLAG_IN_CALL;
+ 
+-	  if ((source->flags & G_SOURCE_CAN_RECURSE) == 0 &&
+-	      !SOURCE_DESTROYED (source))
++	  if (SOURCE_BLOCKED (source) && !SOURCE_DESTROYED (source))
+ 	    unblock_source (source);
+ 	  
+ 	  /* Note: this depends on the fact that we can't switch
Signature · 1 line
1.7.11.4
#1 lore raw

PATCH 1/1 libglib2: Fix midori save file dialog not being rendered

Valentine,

Thanks for all your great patches!

Quoted 1 line · Valentine Barshak

This is a known issue, which has been fixed in glib 2.32.2.

Is there anything that prevents us from bumping libglib2 to this version instead of backporting patches?

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 libglib2: Fix midori save file dialog not being rendered

Quoted 1 line · Thomas Petazzoni

Valentine,

Hi Thomas,

Quoted 2 lines

Thanks for all your great patches!

Thank you! I've been using buildroot for a while and I really like it. Just want to have as little deviations from the mainstream as possible :)

Quoted 7 lines · Valentine Barshak
Quoted 2 lines

This is a known issue, which has been fixed in glib 2.32.2.

Is there anything that prevents us from bumping libglib2 to this version instead of backporting patches?

I tried to bump to 2.32.2 (and higher), but it didn't work for me. It doesn't build as is. It needs additional hacks to the libglib2-optional-ipv6.patch plus some minor configure script changes (at least).

Even when I finally managed to build it, it didn't work. Starting any gtk application would result in no window being displayed. I've tried on a real x86 machine and vmware with no luck.
It just hangs without displaying any errors or warnings. It's gonna take some time to debug. Probably some other packages have to be updated as well, I'm not sure.

Since cherry-picking this single change worked fine for me, I've decided to stick with it at least for now.

Quoted 5 lines

Best regards,

Thomas

Thanks,
Val.

#3 lore raw

PATCH 1/1 libglib2: Fix midori save file dialog not being rendered

Quoted 5 lines · Valentine Barshak
Quoted 1 line

Thanks for all your great patches!

Thank you! I've been using buildroot for a while and I really like it. Just want to have as little deviations from the mainstream as possible :)

That's certainly a good motivation :)

Quoted 15 lines
Quoted 2 lines

Is there anything that prevents us from bumping libglib2 to this version instead of backporting patches?

I tried to bump to 2.32.2 (and higher), but it didn't work for me. It doesn't build as is. It needs additional hacks to the libglib2-optional-ipv6.patch plus some minor configure script changes (at least).

Even when I finally managed to build it, it didn't work. Starting any gtk application would result in no window being displayed. I've tried on a real x86 machine and vmware with no luck. It just hangs without displaying any errors or warnings. It's gonna take some time to debug. Probably some other packages have to be updated as well, I'm not sure.

Quoted 2 lines

Since cherry-picking this single change worked fine for me, I've decided to stick with it at least for now.

Argh, ok. I hope someone will find the time to fix this. It's not great to get stuck with older versions due to regressions.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/1 libglib2: Fix midori save file dialog not being rendered

Quoted 26 lines · Thomas Petazzoni
Quoted 5 lines · Valentine Barshak
Quoted 1 line

Thanks for all your great patches!

Thank you! I've been using buildroot for a while and I really like it. Just want to have as little deviations from the mainstream as possible :)

That's certainly a good motivation :)

Quoted 15 lines
Quoted 2 lines

Is there anything that prevents us from bumping libglib2 to this version instead of backporting patches?

I tried to bump to 2.32.2 (and higher), but it didn't work for me. It doesn't build as is. It needs additional hacks to the libglib2-optional-ipv6.patch plus some minor configure script changes (at least).

Even when I finally managed to build it, it didn't work. Starting any gtk application would result in no window being displayed. I've tried on a real x86 machine and vmware with no luck. It just hangs without displaying any errors or warnings. It's gonna take some time to debug. Probably some other packages have to be updated as well, I'm not sure.

Quoted 5 lines
Quoted 2 lines

Since cherry-picking this single change worked fine for me, I've decided to stick with it at least for now.

Argh, ok. I hope someone will find the time to fix this. It's not great to get stuck with older versions due to regressions.

Yeah, it would be better to move to the newer version, but it might take some time, since it doesn't seem to work as is.

Meanwhile, can we have this fix?

Thanks,
Val.

Quoted 5 lines

Best regards,

Thomas

#5 lore raw

PATCH 1/1 libglib2: Fix midori save file dialog not being rendered

Dear Valentine Barshak,

Quoted 7 lines · Valentine Barshak
Quoted 2 lines

Argh, ok. I hope someone will find the time to fix this. It's not great to get stuck with older versions due to regressions.

Yeah, it would be better to move to the newer version, but it might take some time, since it doesn't seem to work as is.

Meanwhile, can we have this fix?

Yes, I don't have any problem getting this fix in until someone bumps libglib2 to a newer version.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com