Bug 261971 - oxygen-gtk breaks virt-manager menus
Summary: oxygen-gtk breaks virt-manager menus
Status: CLOSED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: gtk2-engine (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-03 17:23 UTC by Magnus Tuominen
Modified: 2011-07-29 23:35 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Tuominen 2011-01-03 17:23:13 UTC
oxygen-gtk doesn't show the dropdown menus right in virt-manager.

Version: oxygen-gtk.x86_64 0:1.0.0-1.fc14
KDE: 4.5.4
Fedora 14 x86_64 kde-testing
Screenshot: http://magnu5.fedorapeople.org/screens/virt-man2.png
Comment 1 Ruslan Kabatsayev 2011-01-03 17:26:07 UTC
What do you mean 'right'? Do you mean its excess width? If yes, try latest git - it's fixed there (though there may be flicker because the list is resized on first draw).
Comment 2 Hugo Pereira Da Costa 2011-01-03 17:31:35 UTC
@ruslan
Nah. your fix doesn't fix.
The issue is that the items in the list are truncated (because of the scrollbar),
and there is no horizontal scrollbar. So you can't see whats missing.

Since we don't play with it ourselves, it might actually be a gtk bug, in fact, triggered by our appears-as-list for gtk combobox.

I'll investigate a bit as soon as I get a hand on virt-manager.
Comment 3 Ruslan Kabatsayev 2011-01-03 17:33:39 UTC
OK, i think it's because of scrolled window policy. It should be set to automatic for both scrollbars if it isn't. I'll check it.
Comment 4 Hugo Pereira Da Costa 2011-01-03 17:34:17 UTC
@Ruslan:
 
This is also possibly an issue with the 6 pixels we manually add to the left of
the list to have our comboboxes look right (you know which hack I'm talking
about :))

And not a gtk bug.
In fact, this is pretty likely.
Comment 5 Ruslan Kabatsayev 2011-01-03 17:57:22 UTC
Just tested this in QtCurve, and it appeared that sometimes combobox width changes, while we have set fixed size for its cells, and so the cell has the width we set (regardless of text length), thus not requiring horizontal scrollbar.
Comment 6 Hugo Pereira Da Costa 2011-01-03 18:01:29 UTC
Clear enough.
So it is related to our hack.
Comment 7 Hugo Pereira Da Costa 2011-01-03 18:22:22 UTC
Ruslan:
I think we do not need the "set_fix_size" for any CellRender but GtkCellRendererPixbuf.

so just adding an if( GTK_IS_CELL_RENDERER_PIXBUF( r ) ) condition before calling setFixedSize seems to fix everything here. Can you confirm ?
Comment 8 Ruslan Kabatsayev 2011-01-03 18:23:56 UTC
Ha! How couldn't i guess to use this macro... (i tried to read "pixbuf" property to check for it :) ).
Yes, it works this way.
Comment 9 Hugo Pereira Da Costa 2011-01-03 18:28:30 UTC
I'm committing and closing then. All right ? 
That was easier than I thought
Comment 10 Hugo Pereira Da Costa 2011-01-03 18:30:06 UTC
commit dde5d46a0d2fe4b5c767128ec4a134d9f12dcb3a
branch 1.0
Author: Hugo Pereira Da Costa <hugo@oxygen-icons.org>
Date:   Mon Jan 3 18:28:18 2011 +0100

    Only force size of renderers for GtkCellRendererPixbuf.
    CCBUG: 261971

diff --git a/src/animations/oxygencomboboxdata.cpp b/src/animations/oxygencomboboxdata.cpp
index 77bebc4..3e43a30 100644
--- a/src/animations/oxygencomboboxdata.cpp
+++ b/src/animations/oxygencomboboxdata.cpp
@@ -144,7 +144,10 @@ namespace Oxygen
             gtk_cell_renderer_get_size( r, _cell._widget, 0L, 0L, 0L, &xsize, &ysize );
 
             gtk_cell_renderer_set_padding( r, std::max( 6, xpad ), ypadmax );
-            gtk_cell_renderer_set_fixed_size( r, xsize+6, ysize + ypadmax );
+
+            if( GTK_IS_CELL_RENDERER_PIXBUF( r ) )
+            { gtk_cell_renderer_set_fixed_size( r, xsize+6, ysize + ypadmax ); }
+
         }
 
         if( renderers ) g_list_free( renderers );
Comment 11 Hugo Pereira Da Costa 2011-01-03 18:30:41 UTC
That fixes it.
Thanks for reporting !
Comment 12 Magnus Tuominen 2011-01-05 19:25:19 UTC
Thanks for fixing this so fast! Tested and is working.
Comment 13 Hugo Pereira Da Costa 2011-01-05 19:32:46 UTC
No problem.
I hope it will encourage people to actually file bug reports when they find something is wrong. We usually try to answer rapidly.