Mageia Bugzilla – Attachment 4103 Details for
Bug 10256
oxygen-gtk3 makes apps to segfault with broadway backend
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
this one without the change to the version number in CMakeLists.txt
backend-v2.patch (text/plain), 5.45 KB, created by
Hugo Pereira Da Costa
on 2013-06-05 11:22:10 CEST
(
hide
)
Description:
this one without the change to the version number in CMakeLists.txt
Filename:
MIME Type:
Creator:
Hugo Pereira Da Costa
Created:
2013-06-05 11:22:10 CEST
Size:
5.45 KB
patch
obsolete
>################################## >diff --git a/src/animations/oxygenbackgroundhintengine.cpp b/src/animations/oxygenbackgroundhintengine.cpp >index 45030c2..7010d63 100644 >--- a/src/animations/oxygenbackgroundhintengine.cpp >+++ b/src/animations/oxygenbackgroundhintengine.cpp >@@ -36,7 +36,7 @@ namespace Oxygen > > // create background gradient atom > GdkDisplay *display( gdk_display_get_default () ); >- if( display ) >+ if( display && GDK_IS_X11_DISPLAY( display ) ) > { > > _backgroundGradientAtom = XInternAtom( GDK_DISPLAY_XDISPLAY( display ), "_KDE_OXYGEN_BACKGROUND_GRADIENT", False); >diff --git a/src/animations/oxygenpaneddata.cpp b/src/animations/oxygenpaneddata.cpp >index 5a2d6fa..6c44fd3 100644 >--- a/src/animations/oxygenpaneddata.cpp >+++ b/src/animations/oxygenpaneddata.cpp >@@ -21,6 +21,7 @@ > #include "oxygenpaneddata.h" > > #include <cassert> >+#include <gdk/gdkx.h> > > namespace Oxygen > { >@@ -53,9 +54,12 @@ namespace Oxygen > assert( !_cursor ); > > GdkDisplay *display( gtk_widget_get_display( widget ) ); >- const bool vertical( gtk_orientable_get_orientation( GTK_ORIENTABLE( widget ) ) == GTK_ORIENTATION_VERTICAL ); >- _cursor = gdk_cursor_new_from_name( display, vertical ? "col-resize":"row-resize" ); >- _cursorLoaded = true; >+ if( GDK_IS_X11_DISPLAY( display ) ) >+ { >+ const bool vertical( gtk_orientable_get_orientation( GTK_ORIENTABLE( widget ) ) == GTK_ORIENTATION_VERTICAL ); >+ _cursor = gdk_cursor_new_from_name( display, vertical ? "col-resize":"row-resize" ); >+ _cursorLoaded = true; >+ } > > } > >diff --git a/src/oxygenshadowhelper.cpp b/src/oxygenshadowhelper.cpp >index c0d8fa0..a3b9620 100644 >--- a/src/oxygenshadowhelper.cpp >+++ b/src/oxygenshadowhelper.cpp >@@ -245,8 +245,8 @@ namespace Oxygen > } > > // get display and check >- Display* display( GDK_DISPLAY_XDISPLAY( gdk_screen_get_display( screen ) ) ); >- if( !display ) >+ GdkDisplay *display( gdk_screen_get_display( screen ) ); >+ if( !( display && GDK_IS_X11_DISPLAY( display ) ) ) > { > > #if OXYGEN_DEBUG >@@ -256,7 +256,8 @@ namespace Oxygen > return; > } > >- _atom = XInternAtom( display, "_KDE_NET_WM_SHADOW", False); >+ _atom = XInternAtom( GDK_DISPLAY_XDISPLAY( display ), "_KDE_NET_WM_SHADOW", False); >+ > } > > // make sure size is valid >@@ -372,6 +373,9 @@ namespace Oxygen > GdkWindow *window = gtk_widget_get_window( widget ); > GdkDisplay *display = gtk_widget_get_display( widget ); > >+ // do nothing if display is invalid >+ if( !GDK_IS_X11_DISPLAY( display ) ) return; >+ > std::vector<unsigned long> data; > const bool isMenu( this->isMenu( widget ) ); > >@@ -413,7 +417,8 @@ namespace Oxygen > > GdkWindow *window = gtk_widget_get_window( widget ); > GdkDisplay *display = gtk_widget_get_display( widget ); >- XDeleteProperty( GDK_DISPLAY_XDISPLAY( display ), GDK_WINDOW_XID(window), _atom); >+ if( GDK_IS_X11_DISPLAY( display ) ) >+ { XDeleteProperty( GDK_DISPLAY_XDISPLAY( display ), GDK_WINDOW_XID(window), _atom); } > > } > >diff --git a/src/oxygenwindowmanager.cpp b/src/oxygenwindowmanager.cpp >index 0450597..6fa8303 100644 >--- a/src/oxygenwindowmanager.cpp >+++ b/src/oxygenwindowmanager.cpp >@@ -403,30 +403,33 @@ namespace Oxygen > GdkDisplay *display = gtk_widget_get_display( GTK_WIDGET( topLevel ) ); > GdkWindow *root = gdk_screen_get_root_window( gtk_window_get_screen( topLevel ) ); > >- xev.xclient.type = ClientMessage; >- xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display(display, "_NET_WM_MOVERESIZE"); >- xev.xclient.display = GDK_DISPLAY_XDISPLAY(display); >- xev.xclient.window = GDK_WINDOW_XID(window); >- xev.xclient.format = 32; >- xev.xclient.data.l[0] = x; >- xev.xclient.data.l[1] = y; >- xev.xclient.data.l[2] = 8; // NET::Move >- xev.xclient.data.l[3] = Button1; >- xev.xclient.data.l[4] = 0; >- XUngrabPointer(GDK_DISPLAY_XDISPLAY(display), CurrentTime); >- >- XSendEvent( >- GDK_DISPLAY_XDISPLAY(display), >- GDK_WINDOW_XID(root), >- False, >- SubstructureRedirectMask | SubstructureNotifyMask, >- &xev); >+ if( GDK_IS_X11_DISPLAY( display ) ) >+ { >+ >+ xev.xclient.type = ClientMessage; >+ xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display(display, "_NET_WM_MOVERESIZE"); >+ xev.xclient.display = GDK_DISPLAY_XDISPLAY(display); >+ xev.xclient.window = GDK_WINDOW_XID(window); >+ xev.xclient.format = 32; >+ xev.xclient.data.l[0] = x; >+ xev.xclient.data.l[1] = y; >+ xev.xclient.data.l[2] = 8; // NET::Move >+ xev.xclient.data.l[3] = Button1; >+ xev.xclient.data.l[4] = 0; >+ XUngrabPointer(GDK_DISPLAY_XDISPLAY(display), CurrentTime); >+ >+ XSendEvent( >+ GDK_DISPLAY_XDISPLAY(display), >+ GDK_WINDOW_XID(root), >+ False, >+ SubstructureRedirectMask | SubstructureNotifyMask, >+ &xev); >+ >+ } > > // force a release as some widgets miss it... > finishDrag(); > >- // wmButtonRelease( widget, 0L, this ); >- > return true; > } >
################################## diff --git a/src/animations/oxygenbackgroundhintengine.cpp b/src/animations/oxygenbackgroundhintengine.cpp index 45030c2..7010d63 100644 --- a/src/animations/oxygenbackgroundhintengine.cpp +++ b/src/animations/oxygenbackgroundhintengine.cpp @@ -36,7 +36,7 @@ namespace Oxygen // create background gradient atom GdkDisplay *display( gdk_display_get_default () ); - if( display ) + if( display && GDK_IS_X11_DISPLAY( display ) ) { _backgroundGradientAtom = XInternAtom( GDK_DISPLAY_XDISPLAY( display ), "_KDE_OXYGEN_BACKGROUND_GRADIENT", False); diff --git a/src/animations/oxygenpaneddata.cpp b/src/animations/oxygenpaneddata.cpp index 5a2d6fa..6c44fd3 100644 --- a/src/animations/oxygenpaneddata.cpp +++ b/src/animations/oxygenpaneddata.cpp @@ -21,6 +21,7 @@ #include "oxygenpaneddata.h" #include <cassert> +#include <gdk/gdkx.h> namespace Oxygen { @@ -53,9 +54,12 @@ namespace Oxygen assert( !_cursor ); GdkDisplay *display( gtk_widget_get_display( widget ) ); - const bool vertical( gtk_orientable_get_orientation( GTK_ORIENTABLE( widget ) ) == GTK_ORIENTATION_VERTICAL ); - _cursor = gdk_cursor_new_from_name( display, vertical ? "col-resize":"row-resize" ); - _cursorLoaded = true; + if( GDK_IS_X11_DISPLAY( display ) ) + { + const bool vertical( gtk_orientable_get_orientation( GTK_ORIENTABLE( widget ) ) == GTK_ORIENTATION_VERTICAL ); + _cursor = gdk_cursor_new_from_name( display, vertical ? "col-resize":"row-resize" ); + _cursorLoaded = true; + } } diff --git a/src/oxygenshadowhelper.cpp b/src/oxygenshadowhelper.cpp index c0d8fa0..a3b9620 100644 --- a/src/oxygenshadowhelper.cpp +++ b/src/oxygenshadowhelper.cpp @@ -245,8 +245,8 @@ namespace Oxygen } // get display and check - Display* display( GDK_DISPLAY_XDISPLAY( gdk_screen_get_display( screen ) ) ); - if( !display ) + GdkDisplay *display( gdk_screen_get_display( screen ) ); + if( !( display && GDK_IS_X11_DISPLAY( display ) ) ) { #if OXYGEN_DEBUG @@ -256,7 +256,8 @@ namespace Oxygen return; } - _atom = XInternAtom( display, "_KDE_NET_WM_SHADOW", False); + _atom = XInternAtom( GDK_DISPLAY_XDISPLAY( display ), "_KDE_NET_WM_SHADOW", False); + } // make sure size is valid @@ -372,6 +373,9 @@ namespace Oxygen GdkWindow *window = gtk_widget_get_window( widget ); GdkDisplay *display = gtk_widget_get_display( widget ); + // do nothing if display is invalid + if( !GDK_IS_X11_DISPLAY( display ) ) return; + std::vector<unsigned long> data; const bool isMenu( this->isMenu( widget ) ); @@ -413,7 +417,8 @@ namespace Oxygen GdkWindow *window = gtk_widget_get_window( widget ); GdkDisplay *display = gtk_widget_get_display( widget ); - XDeleteProperty( GDK_DISPLAY_XDISPLAY( display ), GDK_WINDOW_XID(window), _atom); + if( GDK_IS_X11_DISPLAY( display ) ) + { XDeleteProperty( GDK_DISPLAY_XDISPLAY( display ), GDK_WINDOW_XID(window), _atom); } } diff --git a/src/oxygenwindowmanager.cpp b/src/oxygenwindowmanager.cpp index 0450597..6fa8303 100644 --- a/src/oxygenwindowmanager.cpp +++ b/src/oxygenwindowmanager.cpp @@ -403,30 +403,33 @@ namespace Oxygen GdkDisplay *display = gtk_widget_get_display( GTK_WIDGET( topLevel ) ); GdkWindow *root = gdk_screen_get_root_window( gtk_window_get_screen( topLevel ) ); - xev.xclient.type = ClientMessage; - xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display(display, "_NET_WM_MOVERESIZE"); - xev.xclient.display = GDK_DISPLAY_XDISPLAY(display); - xev.xclient.window = GDK_WINDOW_XID(window); - xev.xclient.format = 32; - xev.xclient.data.l[0] = x; - xev.xclient.data.l[1] = y; - xev.xclient.data.l[2] = 8; // NET::Move - xev.xclient.data.l[3] = Button1; - xev.xclient.data.l[4] = 0; - XUngrabPointer(GDK_DISPLAY_XDISPLAY(display), CurrentTime); - - XSendEvent( - GDK_DISPLAY_XDISPLAY(display), - GDK_WINDOW_XID(root), - False, - SubstructureRedirectMask | SubstructureNotifyMask, - &xev); + if( GDK_IS_X11_DISPLAY( display ) ) + { + + xev.xclient.type = ClientMessage; + xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display(display, "_NET_WM_MOVERESIZE"); + xev.xclient.display = GDK_DISPLAY_XDISPLAY(display); + xev.xclient.window = GDK_WINDOW_XID(window); + xev.xclient.format = 32; + xev.xclient.data.l[0] = x; + xev.xclient.data.l[1] = y; + xev.xclient.data.l[2] = 8; // NET::Move + xev.xclient.data.l[3] = Button1; + xev.xclient.data.l[4] = 0; + XUngrabPointer(GDK_DISPLAY_XDISPLAY(display), CurrentTime); + + XSendEvent( + GDK_DISPLAY_XDISPLAY(display), + GDK_WINDOW_XID(root), + False, + SubstructureRedirectMask | SubstructureNotifyMask, + &xev); + + } // force a release as some widgets miss it... finishDrag(); - // wmButtonRelease( widget, 0L, this ); - return true; }
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 10256
:
4043
|
4098
|
4102
| 4103