[Libreoffice] [PUSHED] GTK+ integration

2011-05-24 Thread Michael Meeks

On Tue, 2011-05-24 at 14:14 +0100, Michael Meeks wrote:
   Sure, I've pushed it to the -3-4 branch as well.

Ho hum; I've reverted it there. I'm getting some funky debug output on
the console:

Warning: -writer is deprecated.  Use --writer instead.

(soffice:14656): GLib-GObject-WARNING **: invalid cast from 
`GtkToggleToolButton' to `GtkButton'

(soffice:14656): Gtk-CRITICAL **: IA__gtk_button_set_relief: assertion 
`GTK_IS_BUTTON (button)' failed

(soffice:14656): Gtk-CRITICAL **: IA__gtk_widget_style_get: assertion 
`GTK_IS_WIDGET (widget)' failed

Doesn't look ideal :-) Whacking a breakpoint in g_logv gives me some
nice traces:

#2  0xb2ac69c5 in g_type_check_instance_cast ()
from /lib/libgobject-2.0.so.0
#3  0xb33403e4 in NWEnsureGTKToolbar (nScreen=0)
at 
/data/opt/libreoffice/bootstrap/clone/libs-gui/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx:4007
#4  0xb333dc56 in NWGetToolbarRect (nScreen=0, nPart=100, aAreaRect=...)
at 
/data/opt/libreoffice/bootstrap/clone/libs-gui/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx:3300
#5  0xb3334f2c in GtkSalGraphics::getNativeControlRegion
(this=0x891a380, nType=100, nPart=100, rControlRegion=..., nState=9,
aValue=..., rCaption=..., 
rNativeBoundingRegion=..., rNativeContentRegion=...)
at 
/data/opt/libreoffice/bootstrap/clone/libs-gui/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx:982

and

#2  0xb29dba8d in g_return_if_fail_warning () from /lib/libglib-2.0.so.0
#3  0xb2edc8f5 in gtk_button_set_relief ()
from /usr/lib/libgtk-x11-2.0.so.0
#4  0xb33403f0 in NWEnsureGTKToolbar (nScreen=0)
at 
/data/opt/libreoffice/bootstrap/clone/libs-gui/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx:4007

eg. - apparently it is not a GtkButton :-)

Any chance of some digging ?

Thanks,

Michael.

-- 
 michael.me...@novell.com  , Pseudo Engineer, itinerant idiot


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PUSHED] GTK+ integration

2011-01-25 Thread Michael Meeks
Hi there,

Firstly - nice work - this looks promising, and sorry for the delay,
things have been busy today with the 3.3.0 release.

On Mon, 2011-01-24 at 19:39 +0100, xapantu wrote:
 I have just made a patch to fix some glitch with GTK+:
 (see this bug: https://bugs.freedesktop.org//show_bug.cgi?id=32186)

Soo ... :-) I had a few comments / queries.

 - Fix menubar root items (they was disabled, but they work well :) )

Interesting; it might be nice to capture the type that is, we already
have a:

((nType == CTRL_MENUBAR) 
(   (nPart==PART_ENTIRE_CONTROL) )  )   ||

in IsNativeControlSupported, can we just add another nPart to it, as in
the other options ?

 - Don't draw anything when a disabled menu is hovered:
 They was drawn using the native GUI engine, which provided bad
 integration. GTK+ just don't react when we move the cursor on
 disabled menu items (at least, on most themes), so, we just draw
 nothing now. (and if we should, drawing nothing for disabled
 menu is better than draw a bad integration for a menu *which is
 not used*). 

Right; so - this was a fix for a crasher [ incidentally we should
prolly dig out similar obsolete fixes in this code ]. Since it affects
only the 5 year old Fedora Core 4 (that we know) with crux theme - I
added a check like this:

@@ -2731,9 +2731,10 @@ BOOL GtkSalGraphics::NWPaintGTKPopupMenu(
 const OUString )
 {
 // #i50745# gtk does not draw disabled menu entries (and crux theme
-// even crashes), draw them using vcl functionality.
-if( nPart == PART_MENU_ITEM  ! (nState  CTRL_STATE_ENABLED) )
-return FALSE;
+// even crashes) in very old (Fedora Core 4 vintage) gtk's
+if (gtk_major_version = 2  gtk_minor_version = 8 
+nPart == PART_MENU_ITEM  ! (nState  CTRL_STATE_ENABLED) )
+return TRUE;
 
Hopefully it does what we want and mitigates the risk :-)

 - Fix background of GtkEntry/GtkSpinButton:
 gtk_paint_flat_box was used, just replace it by gtk_paint_box.
 gtk_paint_flat_box just draws a… flat rectangle, but the
 background can be rounded. So, on dark theme it could caused
 some glitchs (see screenshot).

That is fine.

 - Fix GtkButton/GtkSpinButton background (and maybe some others
 widget) :
 In the code, we redrew the background before drawing the
 widgets, because they could be transparent, but it wasn't the
 good style for the background (widgets background instead of
 window background).

Hmm, that makes some sense - but it still concerns me ;-) I hope you
know what you're doing.

 This patch belongs to the libs-gui branch, vcl module.

I've pushed it - thanks so much ! if you're in that neck of the woods -
do you test with larger theme font sizes ? :-) (cf. my attached
toolbar ).

Also - I assume your changes are under the LGPLv3+/MPL combination we
recommend - can you confirm that ! oh, and if you could close the bug
that'd be great too :-)

Looking forward to seeing what you get up to next,

Many thanks !

Michael.

-- 
 michael.me...@novell.com  , Pseudo Engineer, itinerant idiot

attachment: annoying.png___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice