Bug 299321 - OptionMenu: pop->scroll leads to assertion `style->depth == gdk_drawable_get_depth (window)' failed
Summary: OptionMenu: pop->scroll leads to assertion `style->depth == gdk_drawable_get_...
Status: CLOSED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: gtk2-engine (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-03 19:02 UTC by Ruslan Kabatsayev
Modified: 2012-05-15 04:06 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ruslan Kabatsayev 2012-05-03 19:02:44 UTC
See steps to reproduce

Reproducible: Always

Steps to Reproduce:
1. Launch nvidia-settings or any other app with GtkOptionMenu
2. Popup an option menu, then pop it down.
3. Scroll above the option menu button to go to next option
4. See the text of current item disappear
5. After reselecting it via menu the text reappears
Actual Results:  
Text (and probably icon) disappears in the some of the option menu items

Expected Results:  
Text shouldn't disappear

It seems that the reason for this is that the item's depth is only changed when the menu appears, and when we just scroll to switch current item, new depth isn't applied.
Comment 1 Hugo Pereira Da Costa 2012-05-03 20:58:22 UTC
This is because the GtkMenuItems are only registered to engine (and parentSet signal connected), only once they have been selected once.
If you go and select one by one the items in the menu, then there is no more issue, and the engine does its job.

In the past this was working better cause we where using a hook (connected at GtkMenuItem's creation)
but at some point this failed, and I changed the code to its current state.
 8710e03009c987db65b27a877b8e682bfc3101fd
 moved style re-attachement from oxygenargbhelper to dedicated menuItem engine.
 CCBUG: 295803

Obviously this is not sufficient.
I need to find a smarter way to register the menuItems to the engine.
Maybe by triggering on menu being shown and looping over its children at that time.
Comment 2 Hugo Pereira Da Costa 2012-05-03 21:21:05 UTC
Git commit 4c05651de7da088f0b93e6c949abb56431ff8a67 by Hugo Pereira Da Costa.
Committed on 03/05/2012 at 23:19.
Pushed by hpereiradacosta into branch 'master'.

Register all GtkMenuItems to MenuItemEngine via their parent menu, the first time it is shown.

M  +1    -0    src/CMakeLists.txt
C  +23   -28   src/animations/oxygenmenuitemengine.cpp [from: src/animations/oxygenmenuitemengine.h - 051% similarity]
M  +3    -0    src/animations/oxygenmenuitemengine.h
M  +3    -0    src/oxygenstylewrapper.cpp

http://commits.kde.org/oxygen-gtk/4c05651de7da088f0b93e6c949abb56431ff8a67
Comment 3 Hugo Pereira Da Costa 2012-05-03 21:22:59 UTC
That should fix it. Please confirm and close.
I'll merge with the other branches (1.2 and gtk3's) after confirmation.
Comment 4 Ruslan Kabatsayev 2012-05-04 09:02:37 UTC
I confirm that this is now fixed. Thanks.
Comment 5 Hugo Pereira Da Costa 2012-05-04 10:32:26 UTC
Git commit e9294fccc535094f1a902120cde34b65f2639769 by Hugo Pereira Da Costa.
Committed on 03/05/2012 at 23:19.
Pushed by hpereiradacosta into branch '1.2'.

Register all GtkMenuItems to MenuItemEngine via their parent menu, the first time it is shown.

M  +1    -0    src/CMakeLists.txt
C  +23   -28   src/animations/oxygenmenuitemengine.cpp [from: src/animations/oxygenmenuitemengine.h - 051% similarity]
M  +3    -0    src/animations/oxygenmenuitemengine.h
M  +3    -0    src/oxygenstylewrapper.cpp

http://commits.kde.org/oxygen-gtk/e9294fccc535094f1a902120cde34b65f2639769
Comment 6 Hugo Pereira Da Costa 2012-05-04 10:32:28 UTC
Git commit 4045e710bd1093aa602c93c15bf968dae006f6e2 by Hugo Pereira Da Costa.
Committed on 03/05/2012 at 23:19.
Pushed by hpereiradacosta into branch 'gtk3'.

Register all GtkMenuItems to MenuItemEngine via their parent menu, the first time it is shown.

M  +1    -0    src/CMakeLists.txt
C  +23   -28   src/animations/oxygenmenuitemengine.cpp [from: src/animations/oxygenmenuitemengine.h - 051% similarity]
M  +3    -0    src/animations/oxygenmenuitemengine.h
M  +3    -0    src/oxygenthemingengine.cpp

http://commits.kde.org/oxygen-gtk/4045e710bd1093aa602c93c15bf968dae006f6e2