Hello community, here is the log from the commit of package oxygen-gtk3 for openSUSE:Factory checked in at 2014-08-27 07:46:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/oxygen-gtk3 (Old) and /work/SRC/openSUSE:Factory/.oxygen-gtk3.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "oxygen-gtk3" Changes: -------- --- /work/SRC/openSUSE:Factory/oxygen-gtk3/oxygen-gtk3.changes 2014-04-14 12:08:35.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.oxygen-gtk3.new/oxygen-gtk3.changes 2014-08-27 07:47:01.000000000 +0200 @@ -1,0 +2,6 @@ +Sat Jul 5 20:27:19 UTC 2014 - [email protected] + +- Update to 1.4.0 + * New upstream release, no changelog provided from upstream + +------------------------------------------------------------------- Old: ---- oxygen-gtk3-1.3.5.tar.bz2 New: ---- oxygen-gtk3-1.4.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ oxygen-gtk3.spec ++++++ --- /var/tmp/diff_new_pack.XfF0Qs/_old 2014-08-27 07:47:03.000000000 +0200 +++ /var/tmp/diff_new_pack.XfF0Qs/_new 2014-08-27 07:47:03.000000000 +0200 @@ -17,7 +17,7 @@ Name: oxygen-gtk3 -Version: 1.3.5 +Version: 1.4.0 Release: 0 Summary: A Port of the default KDE Widget Theme (Oxygen), to GTK 3.x License: LGPL-2.1+ ++++++ oxygen-gtk3-1.3.5.tar.bz2 -> oxygen-gtk3-1.4.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/CMakeLists.txt new/oxygen-gtk3-1.4.0/CMakeLists.txt --- old/oxygen-gtk3-1.3.5/CMakeLists.txt 2014-04-10 08:47:47.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/CMakeLists.txt 2014-07-02 12:07:10.000000000 +0200 @@ -12,8 +12,8 @@ set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Oxygen Gtk3 theme" ) set( CPACK_PACKAGE_VENDOR "[email protected]" ) set( CPACK_PACKAGE_VERSION_MAJOR "1" ) -set( CPACK_PACKAGE_VERSION_MINOR "3" ) -set( CPACK_PACKAGE_VERSION_PATCH "5" ) +set( CPACK_PACKAGE_VERSION_MINOR "4" ) +set( CPACK_PACKAGE_VERSION_PATCH "0" ) set( CPACK_SOURCE_IGNORE_FILES "build" "^${PROJECT_SOURCE_DIR}.*/.git/" ) ################################## diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/rc/gtk-csd.css new/oxygen-gtk3-1.4.0/rc/gtk-csd.css --- old/oxygen-gtk3-1.3.5/rc/gtk-csd.css 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/rc/gtk-csd.css 2014-07-02 12:07:10.000000000 +0200 @@ -2,48 +2,35 @@ /******* * CSD * *******/ -.titlebar { - border-radius: 7px 7px 0px 0px; +.titlebar, .headerbar +{ + border-radius: 4px 4px 0px 0px; } -.tiled .titlebar { +.tiled .titlebar, +.tiled .headerbar, +.maximized .titlebar, +.maximized .headerbar +{ border-radius: 0; } -.maximized .titlebar { - border-radius: 0; -} /* this is the default titlebar that is added by GTK * when client-side decorations are in use and the application * did not set a custom titlebar. */ -.titlebar.default-decoration { +.titlebar.default-decoration +{ border: none; box-shadow: none; } -.titlebar .titlebutton { +.titlebar .titlebutton +{ background: none; padding: 5px 5px 6px 5px; border-radius: 3px; } -.window-frame { - border-radius: 4px; - border-width: 1px; - border-style: solid; - - box-shadow: 0 2px 8px 3px black; - - /* this is used for the resize cursor area */ - margin: 10px; -} - -.window-frame.tiled { - border-radius: 0; -} - -.window-frame:backdrop { - box-shadow: 0 2px 5px 1px black; -} +/* shadows are handled in oxygenqtsettings */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/rc/gtk.css new/oxygen-gtk3-1.4.0/rc/gtk.css --- old/oxygen-gtk3-1.3.5/rc/gtk.css 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/rc/gtk.css 2014-07-02 12:07:10.000000000 +0200 @@ -47,16 +47,16 @@ * { -GtkPaned-handle-size: 3px; - -GtkButton-child_displacement_x: 0px; - -GtkButton-child_displacement_y: 0px; + -GtkButton-child_displacement_x: 0; + -GtkButton-child_displacement_y: 0; - -GtkButton-default_border: 0px; - -GtkButton-default_outside_border: 0px; + -GtkButton-default_border: 0; + -GtkButton-default_outside_border: 0; -GtkComboBox-appears-as-list: 1; -GtkMenu-horizontal-offset: -7px; - -GtkMenuBar-internal-padding: 0px; + -GtkMenuBar-internal-padding: 0; -GtkScrolledWindow-scrollbar-spacing: 1px; @@ -71,8 +71,8 @@ -GtkMenubar-shadow-type: none; -GtkToolbar-shadow-type: none; - -GtkWindow-resize-grip-height: 0px; - -GtkWindow-resize-grip-width: 0px; + -GtkWindow-resize-grip-height: 0; + -GtkWindow-resize-grip-width: 0; -GtkWidget-wide-separators: 1; -GtkWidget-separator-width: 3; @@ -86,41 +86,41 @@ .menubar { border-style: none; } GtkStatusBar { border-style: none; } -/* - TODO: - look at default values from GtkCssProvider for better style definitions - (class based, rather than widget based) -*/ - -GtkScale { +/* sliders and scrollbars */ +.scale +{ -GtkRange-slider-width: 23px; -GtkScale-slider-length: 21px; } -GtkScrollbar { +.scrollbar +{ -GtkRange-stepper-size: 12px; - -GtkRange-trough-border: 0px; + -GtkRange-trough-border: 0; } /* menuitems padding */ -GtkMenuBar { - padding: 0px; - border-width: 0px; +.menubar +{ + padding: 0; + border-width: 0; } GtkMenuBar>GtkMenuItem { padding: 4px 5px; } /* menu toolbutton */ -GtkMenuToolButton, GtkMenuToolButton * { - border-width: 0px; - -GtkButton-focus-padding: 0px; - -GtkWidget-focus-line-width: 0px; +GtkMenuToolButton, GtkMenuToolButton * +{ + border-width: 0; + -GtkButton-focus-padding: 0; + -GtkWidget-focus-line-width: 0; } /* notebooks */ -.notebook { - padding: 4px 6px 0px 6px; - border-width: 2px 0px 6px 0px; +.notebook +{ + padding: 6px 8px 2px 8px; + border-width: 2px 0 6px 0; border-style: outset; } @@ -128,27 +128,30 @@ .notebook.header { border-style: none; } /* option menu */ -GtkOptionMenu { padding: 0px 4px; } +GtkOptionMenu { padding: 0 4px; } /* separators */ -GtkSeparator { +.separator +{ border-style: solid; border-width: 3px; } /* frames */ -GtkScrolledWindow { +GtkFrame { padding: 4px; } +GtkScrolledWindow.frame +{ border-style: inset; border-width: 1px; padding: 1px; } -GtkFrame { padding: 4px; } -GtkViewport { padding: 0px; } -GtkProgressBar { padding: 0px; } +.progressbar { padding: 0; } +GtkViewport { padding: 0; } GtkAssistant .sidebar { padding: 4px; } -GtkInfoBar { +GtkInfoBar +{ border-style: solid; border-width: 8px; } @@ -156,37 +159,33 @@ GtkCalendar.view { border-style: inset; } /* switchs */ -GtkSwitch { padding: 0px; } +GtkSwitch { padding: 0; } /* combo boxes */ -GtkComboBox { padding: 0px 0px; } -GtkComboBox>GtkFrame { padding: 0px 0px 0px 4px; } +GtkComboBox { padding: 0; } +GtkComboBox>GtkFrame { padding: 0 0 0 4px; } /* tooltips */ -GtkWindow#gtk-tooltip { padding: 3px; } +.tooltip { padding: 0; } /* buttons */ -GtkButton { padding: 3px 4px 2px; } +.button { padding: 6px 6px 4px; } /* header buttons */ -GtkTreeView>GtkButton { - border-width: 0px 2px; - border-style: solid; -} - -GtkList>GtkButton { - border-width: 0px 2px; +column-header.button +{ + border-width: 0 2px; border-style: solid; } /* entry */ -GtkEntry { padding: 4px 7px; } +.entry { padding: 4px 7px; } /* menu */ -GtkMenu +.menu { padding: 5px; - border-width: 0px; + border-width: 0; } GtkMenu>GtkMenuItem { padding: 5px 4px; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/animations/oxygenanimations.cpp new/oxygen-gtk3-1.4.0/src/animations/oxygenanimations.cpp --- old/oxygen-gtk3-1.3.5/src/animations/oxygenanimations.cpp 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/animations/oxygenanimations.cpp 2014-07-02 12:07:10.000000000 +0200 @@ -117,18 +117,18 @@ _treeViewStateEngine->setEnabled( animationsEnabled && settings.genericAnimationsEnabled() ); _treeViewStateEngine->setDuration( settings.genericAnimationsDuration() ); - _menuBarStateEngine->setAnimationsEnabled( animationsEnabled && (settings.menuBarAnimationType() != None) ); + _menuBarStateEngine->setAnimationsEnabled( animationsEnabled && (settings.menuBarAnimationType() != NoAnimation) ); _menuBarStateEngine->setFollowMouse( settings.menuBarAnimationType() == FollowMouse ); _menuBarStateEngine->setDuration( settings.menuBarAnimationsDuration() ); _menuBarStateEngine->setFollowMouseAnimationsDuration( settings.menuBarFollowMouseAnimationsDuration() ); - _menuStateEngine->setEnabled( animationsEnabled && (settings.menuAnimationType() != None) ); + _menuStateEngine->setEnabled( animationsEnabled && (settings.menuAnimationType() != NoAnimation) ); _menuStateEngine->setFollowMouse( settings.menuAnimationType() == FollowMouse ); _menuStateEngine->setDuration( settings.menuAnimationsDuration() ); _menuStateEngine->setFollowMouseAnimationsDuration( settings.menuFollowMouseAnimationsDuration() ); // for now, only Fade animations mode is supported for toolbar animations - _toolBarStateEngine->setEnabled( animationsEnabled && (settings.toolBarAnimationType() != None) ); + _toolBarStateEngine->setEnabled( animationsEnabled && (settings.toolBarAnimationType() != NoAnimation) ); _toolBarStateEngine->setFollowMouse( settings.toolBarAnimationType() == FollowMouse ); _toolBarStateEngine->setDuration( settings.genericAnimationsDuration() ); _toolBarStateEngine->setFollowMouseAnimationsDuration( settings.toolBarAnimationsDuration() ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygenanimationmodes.h new/oxygen-gtk3-1.4.0/src/oxygenanimationmodes.h --- old/oxygen-gtk3-1.3.5/src/oxygenanimationmodes.h 2014-02-17 11:11:14.000000000 +0100 +++ new/oxygen-gtk3-1.4.0/src/oxygenanimationmodes.h 2014-07-02 11:07:56.000000000 +0200 @@ -36,7 +36,7 @@ /*! used for menubars, toolbars and menus */ enum AnimationType { - None, + NoAnimation, Fade, FollowMouse }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygencairocontext.h new/oxygen-gtk3-1.4.0/src/oxygencairocontext.h --- old/oxygen-gtk3-1.3.5/src/oxygencairocontext.h 2014-03-09 13:12:54.000000000 +0100 +++ new/oxygen-gtk3-1.4.0/src/oxygencairocontext.h 2014-07-02 12:07:10.000000000 +0200 @@ -56,10 +56,6 @@ operator cairo_t* (void) const { return _cr; } - //! context accessor - cairo_t* cr( void ) const - { return _cr; } - //! set clipping void setClipping( GdkRectangle* ) const; @@ -71,24 +67,13 @@ { assert( false ); } //! copy constructor is private - Context( const Context& other ): - _cr( 0L ) - { assert( false ); } + Context( const Context& ); //! equal to operator is private - Context& operator = (const Context& other ) - { - _cr = other._cr; - assert( false ); - return *this; - } + Context& operator = (const Context& ); //! equal to operator is private - Context& operator = (cairo_t* other ) - { - assert( false ); - return *this; - } + Context& operator = (cairo_t* ); //! cairo contect cairo_t* _cr; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygencairoregion.h new/oxygen-gtk3-1.4.0/src/oxygencairoregion.h --- old/oxygen-gtk3-1.3.5/src/oxygencairoregion.h 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygencairoregion.h 2014-07-02 12:07:10.000000000 +0200 @@ -90,6 +90,9 @@ private: + //! equal to operator is private + Region& operator = (cairo_region_t* ); + //! region cairo_region_t* _region; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygencairosurface.h new/oxygen-gtk3-1.4.0/src/oxygencairosurface.h --- old/oxygen-gtk3-1.3.5/src/oxygencairosurface.h 2014-03-09 13:12:54.000000000 +0100 +++ new/oxygen-gtk3-1.4.0/src/oxygencairosurface.h 2014-07-02 12:07:10.000000000 +0200 @@ -95,11 +95,7 @@ private: //! equal to operator is private - Surface& operator = (cairo_surface_t* other ) - { - assert( false ); - return *this; - } + Surface& operator = (cairo_surface_t* ); //! surface cairo_surface_t* _surface; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygengtkutils.cpp new/oxygen-gtk3-1.4.0/src/oxygengtkutils.cpp --- old/oxygen-gtk3-1.3.5/src/oxygengtkutils.cpp 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygengtkutils.cpp 2014-07-02 12:07:10.000000000 +0200 @@ -192,7 +192,7 @@ if( !GTK_IS_WIDGET( widget ) ) return false; if( !gdk_default_screen_is_composited() ) return false; - return gdk_visual_has_rgba( gtk_widget_get_visual (widget) ); + return gdk_visual_has_rgba( gtk_widget_get_visual( widget ) ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygenqtsettings.cpp new/oxygen-gtk3-1.4.0/src/oxygenqtsettings.cpp --- old/oxygen-gtk3-1.3.5/src/oxygenqtsettings.cpp 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygenqtsettings.cpp 2014-07-02 12:07:10.000000000 +0200 @@ -23,6 +23,7 @@ #include "oxygencoloreffect.h" #include "oxygencolorutils.h" #include "oxygenfontinfo.h" +#include "oxygenshadowhelper.h" #include "oxygentimeline.h" #include "config.h" @@ -39,6 +40,11 @@ #include <iostream> #include <sstream> +#ifdef GDK_WINDOWING_X11 +#include <gdk/gdkx.h> +#include <X11/Xatom.h> +#endif + namespace Oxygen { @@ -52,6 +58,8 @@ from the oxygenrc file provided with oxygen-gtk */ QtSettings::QtSettings( void ): + _wmShadowsSupported( false ), + _wmClientSideDecorationSupported( false ), _kdeIconTheme( "oxygen" ), _kdeFallbackIconTheme( "gnome" ), _inactiveChangeSelectionColor( false ), @@ -123,6 +131,26 @@ // keep track of whats changed bool changed( false ); + // support for wm shadows + { + const bool wmShadowsSupported( isAtomSupported( ShadowHelper::netWMShadowAtomName ) ); + if( wmShadowsSupported != _wmShadowsSupported ) + { + _wmShadowsSupported = wmShadowsSupported; + changed |= true; + } + } + + // support for client side decoratiosn + { + const bool wmClientSideDecorationSupported( isAtomSupported( "_GTK_FRAME_EXTENTS" ) ); + if( wmClientSideDecorationSupported != _wmClientSideDecorationSupported ) + { + _wmClientSideDecorationSupported = wmClientSideDecorationSupported; + changed |= true; + } + } + // configuration path { const PathList old( _kdeConfigPathList ); @@ -242,6 +270,74 @@ } + //_______________________________________________________ + bool QtSettings::isAtomSupported( const std::string& atomNameQuery ) const + { + + // create atom + #ifdef GDK_WINDOWING_X11 + + // get screen and check + GdkScreen* screen = gdk_screen_get_default(); + if( !screen ) return false; + + // get display and check + GdkDisplay *gdkDisplay( gdk_screen_get_display( screen ) ); + if( !( gdkDisplay && GDK_IS_X11_DISPLAY( gdkDisplay ) ) ) return false; + Display* display( GDK_DISPLAY_XDISPLAY( gdkDisplay ) ); + + // create atom + Atom netSupportedAtom( XInternAtom( display, "_NET_SUPPORTED", False) ); + if( !netSupportedAtom ) return false; + + // root window + Window root( GDK_WINDOW_XID( gdk_screen_get_root_window( screen ) ) ); + if( !root ) return false; + + Atom type; + int format; + unsigned char *data; + unsigned long count; + unsigned long after; + int length = 32768; + + while( true ) + { + + // get atom property on root window + // length is incremented until after is zero + if( XGetWindowProperty( + display, root, + netSupportedAtom, 0l, length, + false, XA_ATOM, &type, + &format, &count, &after, &data) != Success ) return false; + + if( after == 0 ) break; + + // free data, increase length + XFree( data ); + length *= 2; + continue; + + } + + Atom* atoms = reinterpret_cast<Atom*>( data ); + bool found( false ); + for( unsigned long i = 0; i<count && !found; i++ ) + { + char* atomName = XGetAtomName( display, atoms[i]); + if( strcmp( atomName, atomNameQuery.c_str() ) == 0 ) found = true; + XFree( atomName ); + } + + return found; + + #else + return false; + #endif + + } + //_________________________________________________________ bool QtSettings::loadOxygen( void ) { @@ -725,6 +821,7 @@ "GtkImage, " "GtkInfoBar, " "GtkLabel, " + "GtkLayout, " "GtkMenuItem, " "GtkOverlay, " "GtkRevealer, " @@ -832,12 +929,16 @@ _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_COLOR, _palette.color( Palette::Disabled, Palette::WindowText ) ) ); // tooltips - _css.addSection( "GtkWindow#gtk-tooltip" ); + _css.addSection( ".tooltip" ); _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_BACKGROUND_COLOR, _palette.color( Palette::Tooltip ) ) ); - - _css.addSection( "GtkWindow#gtk-tooltip GtkLabel" ); _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_COLOR, _palette.color( Palette::TooltipText ) ) ); - addLinkColors( "GtkWindow#gtk-tooltip GtkLabel", "[Colors:Tooltip]" ); + + _css.addSection( ".tooltip *" ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_BACKGROUND_COLOR, "transparent" ) ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_COLOR, "inherit" ) ); + + addLinkColors( ".tooltip", "[Colors:Tooltip]" ); + addLinkColors( ".tooltip *", "[Colors:Tooltip]" ); // rubber band selection (at least for nautilus) // FIXME: is Palette::Selected the proper color? Is 0.35 the proper alpha? @@ -1085,19 +1186,19 @@ // menubar animation type std::string menuBarAnimationType( _oxygen.getValue( "[Style]", "MenuBarAnimationType", "MB_FADE") ); - if( menuBarAnimationType == "MB_NONE" ) _menuBarAnimationType = None; + if( menuBarAnimationType == "MB_NONE" ) _menuBarAnimationType = NoAnimation; else if( menuBarAnimationType == "MB_FADE" ) _menuBarAnimationType = Fade; else if( menuBarAnimationType == "MB_FOLLOW_MOUSE" ) _menuBarAnimationType = FollowMouse; // menubar animation type std::string menuAnimationType( _oxygen.getValue( "[Style]", "MenuAnimationType", "ME_FADE") ); - if( menuAnimationType == "ME_NONE" ) _menuAnimationType = None; + if( menuAnimationType == "ME_NONE" ) _menuAnimationType = NoAnimation; else if( menuAnimationType == "ME_FADE" ) _menuAnimationType = Fade; else if( menuAnimationType == "ME_FOLLOW_MOUSE" ) _menuAnimationType = FollowMouse; // toolbar animation type std::string toolBarAnimationType( _oxygen.getValue( "[Style]", "ToolBarAnimationType", "TB_FADE") ); - if( toolBarAnimationType == "TB_NONE" ) _toolBarAnimationType = None; + if( toolBarAnimationType == "TB_NONE" ) _toolBarAnimationType = NoAnimation; else if( toolBarAnimationType == "TB_FADE" ) _toolBarAnimationType = Fade; else if( toolBarAnimationType == "TB_FOLLOW_MOUSE" ) _toolBarAnimationType = FollowMouse; @@ -1245,6 +1346,46 @@ Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_PADDING, "0px 12px 0px 0px" ): Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_PADDING, "0px 0px 0px 12px" ) ); + // CSD titlebar and shadow + setupCssShadows( ".window-frame", true ); + setupCssShadows( ".window-frame.csd.popup", !_wmShadowsSupported ); + + // always disable tooltips because it appears broken + setupCssShadows( ".window-frame.csd.tooltip", false ); + + } + + //_________________________________________________________ + void QtSettings::setupCssShadows( const std::string& section, bool enabled ) + { + + // CSD titlebar and shadows + if( enabled ) + { + // default shadows (copied from Adwaita) + _css.addSection( section ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_BORDER_RADIUS, "4px 4px 0 0" ) ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_BORDER_WIDTH, "0" ) ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_MARGIN, "10px" ) ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( "box-shadow", "0 3px 9px 1px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.23);" ) ); + + _css.addSection( section + ":backdrop" ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( "box-shadow", "0 2px 6px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.18);" ) ); + + } else { + + _css.addSection( section ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_BORDER_RADIUS, "0" ) ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_BORDER_WIDTH, "0" ) ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_BORDER_STYLE, "none" ) ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_MARGIN, "0" ) ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( "box-shadow", "none" ) ); + + _css.addSection( section + ":backdrop" ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( "box-shadow", "none" ) ); + + } + } //_________________________________________________________ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygenqtsettings.h new/oxygen-gtk3-1.4.0/src/oxygenqtsettings.h --- old/oxygen-gtk3-1.3.5/src/oxygenqtsettings.h 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygenqtsettings.h 2014-07-02 12:07:10.000000000 +0200 @@ -73,6 +73,10 @@ Forced = 1<<6 }; + //! sets whether wm shadows are supported + bool isWMShadowsSupported( void ) const + { return _wmShadowsSupported; } + //! returns user config dir std::string userConfigDir( void ) const { return _userConfigDir; } @@ -365,6 +369,9 @@ //! read output from a command - replacement for not always working g_spawn_command_line_sync() bool runCommand( const std::string& command, char*& result ) const; + //! returns true if a given atom is supported + bool isAtomSupported( const std::string& ) const; + //! kdeglobals settings /*! returns true if changed */ bool loadKdeGlobals( void ); @@ -420,6 +427,9 @@ //! extra metrics options void loadExtraOptions( void ); + //! css shadows + void setupCssShadows( const std::string&, bool enabled ); + //! sanitize path std::string sanitizePath( const std::string& ) const; @@ -435,6 +445,13 @@ /*! this is needed to deal with some application hacks */ ApplicationName _applicationName; + //! true if window manager shadows are supported + /*! if true, disable CSD shadows */ + bool _wmShadowsSupported; + + //! true if window manager supports client side decorations + bool _wmClientSideDecorationSupported; + //! kde global options OptionMap _kdeGlobals; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygenrgba.cpp new/oxygen-gtk3-1.4.0/src/oxygenrgba.cpp --- old/oxygen-gtk3-1.3.5/src/oxygenrgba.cpp 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygenrgba.cpp 2014-07-02 12:07:10.000000000 +0200 @@ -78,7 +78,7 @@ "(?:(\\d+),(\\d+),(\\d+)(?:,(\\d+))?)", G_REGEX_CASELESS, (GRegexMatchFlags)0, 0L ); - GMatchInfo* matchInfo; + GMatchInfo* matchInfo(0L); g_regex_match( regex, value.c_str(), (GRegexMatchFlags)0, &matchInfo); const int matchCount( g_match_info_get_match_count( matchInfo ) ); if( matchCount == 2 ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygenshadowhelper.cpp new/oxygen-gtk3-1.4.0/src/oxygenshadowhelper.cpp --- old/oxygen-gtk3-1.3.5/src/oxygenshadowhelper.cpp 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygenshadowhelper.cpp 2014-07-02 12:07:10.000000000 +0200 @@ -29,6 +29,7 @@ #include "config.h" +#include <cstring> #include <iostream> #include <cairo/cairo.h> @@ -41,8 +42,11 @@ namespace Oxygen { + const char* const ShadowHelper::netWMShadowAtomName( "_KDE_NET_WM_SHADOW" ); + //______________________________________________ ShadowHelper::ShadowHelper( void ): + _supported( false ), _size(0), _hooksInitialized( false ) { @@ -153,6 +157,9 @@ bool ShadowHelper::registerWidget( GtkWidget* widget ) { + // do nothing if not supported + if( !_supported ) return false; + // check widget if( !( widget && GTK_IS_WINDOW( widget ) ) ) return false; @@ -274,7 +281,7 @@ return; } - _atom = XInternAtom( GDK_DISPLAY_XDISPLAY( display ), "_KDE_NET_WM_SHADOW", False); + _atom = XInternAtom( GDK_DISPLAY_XDISPLAY( display ), netWMShadowAtomName, False); } @@ -389,6 +396,9 @@ << std::endl; #endif + // do nothing if not supported + if( !_supported ) return; + // check widget if( !GTK_IS_WIDGET( widget ) ) return; @@ -454,9 +464,12 @@ void ShadowHelper::uninstallX11Shadows( GtkWidget* widget ) const { - if( !GTK_IS_WIDGET( widget ) ) return; - #ifdef GDK_WINDOWING_X11 + + // do nothing if not supported + if( !_supported ) return; + + if( !GTK_IS_WIDGET( widget ) ) return; GdkWindow *window = gtk_widget_get_window( widget ); GdkDisplay *display = gtk_widget_get_display( widget ); if( GDK_IS_X11_DISPLAY( display ) ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygenshadowhelper.h new/oxygen-gtk3-1.4.0/src/oxygenshadowhelper.h --- old/oxygen-gtk3-1.3.5/src/oxygenshadowhelper.h 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygenshadowhelper.h 2014-07-02 12:07:10.000000000 +0200 @@ -44,12 +44,25 @@ public: + //!@name property names + //@{ + static const char* const netWMShadowAtomName; + //@} + //! constructor ShadowHelper( void ); //! destructor virtual ~ShadowHelper( void ); + //! true is supported + void setSupported( bool value ) + { _supported = value; } + + //! true if supported + bool isSupported( void ) const + { return _supported; } + //! reset void reset( void ); @@ -106,6 +119,9 @@ private: + //! true if shadows are supported + bool _supported; + //! shadow size int _size; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygenstyle.cpp new/oxygen-gtk3-1.4.0/src/oxygenstyle.cpp --- old/oxygen-gtk3-1.3.5/src/oxygenstyle.cpp 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygenstyle.cpp 2014-07-02 12:07:10.000000000 +0200 @@ -118,6 +118,7 @@ // create window shadow WindowShadow shadow( _settings, _helper ); + _shadowHelper.setSupported( _settings.isWMShadowsSupported() ); _shadowHelper.setApplicationName( _settings.applicationName() ); _shadowHelper.initialize( _settings.palette().color(Palette::Window), shadow ); @@ -491,6 +492,28 @@ } + //__________________________________________________________________ + bool Style::renderTitleBarBackground( + cairo_t* context, GtkWidget* widget, + gint x, gint y, gint w, gint h ) + { + cairo_push_group( context ); + const bool success( Style::instance().renderWindowBackground( context, 0L, widget, x, y, w, h ) ); + cairo_pop_group_to_source( context ); + + Cairo::Surface localSurface( Style::instance().helper().createSurface( w, h ) ); + + Cairo::Context localContext( localSurface ); + cairo_set_source( localContext, ColorUtils::Rgba::black() ); + cairo_rounded_rectangle( localContext, 0, 0, w, h, 4, CornersTopLeft|CornersTopRight ); + cairo_fill( localContext ); + + cairo_mask_surface( context, localSurface, x, y ); + + return success; + + } + //__________________________________________________________________ bool Style::renderGroupBoxBackground( cairo_t* context, GtkWidget* widget, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygenstyle.h new/oxygen-gtk3-1.4.0/src/oxygenstyle.h --- old/oxygen-gtk3-1.3.5/src/oxygenstyle.h 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygenstyle.h 2014-07-02 12:07:10.000000000 +0200 @@ -167,10 +167,13 @@ // render background pixmap bool renderBackgroundPixmap( cairo_t*, GdkWindow*, GtkWidget*, gint, gint, gint, gint, bool isMaximized=false ); + //! titlebar background + bool renderTitleBarBackground( cairo_t*, GtkWidget*, gint, gint, gint, gint ); + //! groupbox background bool renderGroupBoxBackground( cairo_t*, GtkWidget*, gint, gint, gint, gint, const StyleOptions&, TileSet::Tiles = TileSet::Center ); - //! window background + //! menu background bool renderMenuBackground( cairo_t*, gint, gint, gint, gint, const StyleOptions& ) const; //! tooltip background diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygenthemingengine.cpp new/oxygen-gtk3-1.4.0/src/oxygenthemingengine.cpp --- old/oxygen-gtk3-1.3.5/src/oxygenthemingengine.cpp 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygenthemingengine.cpp 2014-07-02 12:07:10.000000000 +0200 @@ -494,10 +494,7 @@ return; - } else if( - gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_TOOLBAR ) || - gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_HEADERBAR ) ) - { + } else if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_TOOLBAR ) ) { // render background if( !Gtk::gtk_widget_is_applet( widget ) ) @@ -510,6 +507,27 @@ render_animated_button( context, widget ); return; + } else if( + gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_TITLEBAR ) || + gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_HEADERBAR ) ) + { + + // render background + if( !Gtk::gtk_widget_is_applet( widget ) ) + { + #if OXYGEN_DEBUG + int r; + const GtkStateFlags state( gtk_theming_engine_get_state( engine ) ); + gtk_theming_engine_get( engine, state, GTK_STYLE_PROPERTY_BORDER_RADIUS, &r, NULL ); + std::cerr << "Oxygen::ThemingEngine::render_background - radius: " << r << std::endl; + #endif + + Style::instance().renderTitleBarBackground( context, widget, x, y, w, h ); + } + + render_animated_button( context, widget ); + return; + } else if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_HEADER ) && Gtk::gtk_widget_path_has_type( path, GTK_TYPE_CALENDAR ) ) { Style::instance().renderWindowBackground( context, 0L, widget, x, y, w, h ); @@ -1360,9 +1378,9 @@ return; } else if( + GTK_IS_FRAME( widget ) && (parent = Gtk::gtk_parent_combobox( widget )) && - !gtk_combo_box_get_has_entry( GTK_COMBO_BOX( parent ) ) && - !GTK_IS_CELL_VIEW( widget ) ) + !gtk_combo_box_get_has_entry( GTK_COMBO_BOX( parent ) ) ) { Style::instance().animations().comboBoxEngine().registerWidget( parent ); @@ -2280,19 +2298,19 @@ << std::endl; #endif - // draw progressbar text white if above indicator, black if not - if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_PROGRESSBAR ) ) - { - - cairo_save( context ); - const ColorUtils::Rgba selection( Style::instance().settings().palette().color( Palette::Active, Palette::SelectedText ) ); - cairo_set_source( context, selection ); - cairo_translate(context,x,y); - pango_cairo_show_layout(context,layout); - cairo_restore( context ); - return; - - } +// // draw progressbar text white if above indicator, black if not +// if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_PROGRESSBAR ) ) +// { +// +// cairo_save( context ); +// const ColorUtils::Rgba selection( Style::instance().settings().palette().color( Palette::Active, Palette::SelectedText ) ); +// cairo_set_source( context, selection ); +// cairo_translate(context,x,y); +// pango_cairo_show_layout(context,layout); +// cairo_restore( context ); +// return; +// +// } const GtkWidgetPath* path( gtk_theming_engine_get_path(engine) ); if( Gtk::gtk_widget_path_has_type( path, GTK_TYPE_LABEL ) ) @@ -2470,8 +2488,8 @@ GtkStateFlags state( gtk_theming_engine_get_state( engine ) ); StyleOptions options( widget, state); - if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_VERTICAL ) ) - { options |= Vertical; } + if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_VERTICAL ) ) options |= Vertical; + if( GTK_IS_PROGRESS_BAR(widget) ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.3.5/src/oxygenwindowmanager.cpp new/oxygen-gtk3-1.4.0/src/oxygenwindowmanager.cpp --- old/oxygen-gtk3-1.3.5/src/oxygenwindowmanager.cpp 2014-04-10 08:47:33.000000000 +0200 +++ new/oxygen-gtk3-1.4.0/src/oxygenwindowmanager.cpp 2014-07-02 12:07:10.000000000 +0200 @@ -722,6 +722,7 @@ if( widgetIsBlackListed( widget ) ) return BlackListed; else if( gtk_widget_get_state_flags( widget )>K_STATE_FLAG_PRELIGHT ) return WidgetIsPrelight; else if( GTK_IS_BUTTON( widget ) ) return WidgetIsButton; + else if( GTK_IS_SCALE( widget ) ) return WidgetIsButton; else if( GTK_IS_MENU_ITEM( widget ) ) return WidgetIsMenuItem; else if( GTK_IS_SCROLLED_WINDOW( widget ) && ( !inNoteBook || gtk_widget_is_focus( widget ) ) ) return WidgetIsScrolledWindow; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
