[packages/oxygen-gtk] - rel 3; back to using popen to avoid lockups (for example google chrome UI freezes entirely); https

arekm arekm at pld-linux.org
Mon Sep 21 22:33:59 CEST 2015


commit 9a2d6eb17d3200c1978d3e878cf33a58f58e13cb
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Sep 21 22:33:51 2015 +0200

    - rel 3; back to using popen to avoid lockups (for example google chrome UI freezes entirely); https://bugs.kde.org/show_bug.cgi?id=352901

 oxygen-gtk-popen.patch | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++
 oxygen-gtk.spec        |  4 ++-
 2 files changed, 75 insertions(+), 1 deletion(-)
---
diff --git a/oxygen-gtk.spec b/oxygen-gtk.spec
index 5aad6b6..f43c97e 100644
--- a/oxygen-gtk.spec
+++ b/oxygen-gtk.spec
@@ -1,11 +1,12 @@
 Summary:	Oxygen-Gtk - a port of the default KDE widget theme (Oxygen), to gtk
 Name:		oxygen-gtk
 Version:	1.4.6
-Release:	2
+Release:	3
 License:	LGPL v2.1
 Group:		Themes/GTK+
 Source0:	http://download.kde.org/stable/oxygen-gtk2/%{version}/src/%{name}2-%{version}.tar.bz2
 # Source0-md5:	493892fc36302bfe862604f667a6c04e
+Patch0:		%{name}-popen.patch
 URL:		https://projects.kde.org/projects/playground/artwork/oxygen-gtk/
 BuildRequires:	cairo-devel
 BuildRequires:	cmake >= 2.8.0
@@ -31,6 +32,7 @@ otherwise breaks everytime some setting is changed in kde.
 
 %prep
 %setup -q -n %{name}2-%{version}
+%patch0 -p1
 
 %build
 install -d build
diff --git a/oxygen-gtk-popen.patch b/oxygen-gtk-popen.patch
new file mode 100644
index 0000000..b24620a
--- /dev/null
+++ b/oxygen-gtk-popen.patch
@@ -0,0 +1,72 @@
+; DIFF BELOW IS REVERT OF THIS COMMIT
+; (all due to g_spawn_command_line_sync still locking up even with glib 2.46.0)
+;
+commit 2068101234271725def6fe91de4a26543b260cba
+Author: Hugo Pereira Da Costa <hugo at oxygen-icons.org>
+Date:   Wed Jun 19 14:17:53 2013 +0200
+
+    Re-added use of g_spawn_command_line_sync in place of popen, to execute an external comment.
+    This effectively reverts commit 51b662b0cd86fd7a960cc2f0c436441d64b2dd44
+    Rational:
+    - the failure of g_spawn_command_line_sync was a glib bug 3.6.0, that got fixed since then (3.6.2)
+    - the use of popen generates unnecessary console when compiled for windows
+    - the use of popen makes it difficult to redirect stderr, which results in error messages being printed
+    on screen when the executed command failed (for instance because the relevant application is not
+    installed.
+    
+    CCBUG: 318891
+
+diff --git b/src/oxygenqtsettings.cpp a/src/oxygenqtsettings.cpp
+index b6cd90c..17217da 100644
+--- b/src/oxygenqtsettings.cpp
++++ a/src/oxygenqtsettings.cpp
+@@ -211,7 +211,30 @@ namespace Oxygen
+ 
+     //_________________________________________________________
+     bool QtSettings::runCommand( const std::string& command, char*& result ) const
+-    { return g_spawn_command_line_sync( command.c_str(), &result, 0L, 0L, 0L ) && result; }
++    {
++
++        if( FILE* fp = popen( command.c_str(), "r" ) )
++        {
++
++            // read command output. Make sure that the buffer is large enough to read the entire
++            // output, by multiplying its initial size by two as long as the last character is not '\n'
++            // note that the allocated string must be freed by the calling method
++            gulong bufSize=512;
++            size_t currentOffset=0;
++            result= static_cast<char*>(g_malloc(bufSize));
++            while( fgets( result+currentOffset, bufSize-currentOffset, fp ) && result[strlen(result)-1] != '\n' )
++            {
++                currentOffset = bufSize-1;
++                bufSize *= 2;
++                result = static_cast<char*>( g_realloc( result, bufSize ) );
++            }
++
++            pclose(fp);
++            return true;
++
++        } else return false;
++
++    }
+ 
+     //_________________________________________________________
+     bool QtSettings::loadKdeGlobals( void )
+@@ -273,7 +296,7 @@ namespace Oxygen
+ 
+         // load icon install prefix
+         gchar* path = 0L;
+-        if( runCommand( "kde4-config --path config", path ) && path )
++        if( runCommand( "kde4-config --path config 2>/dev/null", path ) && path )
+         {
+ 
+             out.split( path );
+@@ -303,7 +326,7 @@ namespace Oxygen
+         // load icon install prefix
+         PathList out;
+         char* path = 0L;
+-        if( runCommand( "kde4-config --path icon", path ) && path )
++        if( runCommand( "kde4-config --path icon 2>/dev/null", path ) && path )
+         {
+             out.split( path );
+             g_free( path );
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/oxygen-gtk.git/commitdiff/9a2d6eb17d3200c1978d3e878cf33a58f58e13cb



More information about the pld-cvs-commit mailing list