-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b68
-
generic
-
solaris_9
When running SwingSet2 on recent Mustang builds, I've wondered why the GTK L&F does
not match my native desktop decorations. I'm running the special GNOME 2.0 for
Solaris 9 that was released a couple years ago before JDS existed.
I think I've figured out the cause: in gtk2_interface.c we load all the necessary
GTK function entrypoints via dlsym(). On versions of GTK prior to 2.4 (according
to the code comments), a couple functions may be missing:
gtk_combo_box_new (was called "gtk_combo_new" pre-2.4)
gtk_separator_tool_item_new (was called "gtk_vseparator_new" pre-2.4)
As the code is currently written, we will load all function symbols via dlsym(),
and when finished we call dlerror() to see if there were any problems loading the
symbols. On systems that have old versions of libgtk-x11-2.0.so.0 (like mine, which
has libgtk-x11-2.0.so.0.100.0) dlerror() will report an error because those two
symbols above are not available, even though we made an attempt to dlsym() their
new counterparts (see the comment about "Some functions may be missing...").
Obviously, the code needs to be restructured so that we only call dlerror() after
loading all the required symbols. Then we need to specially handle the two
functions listed above. If the preferred function is not available (i.e. dlsym()
returns NULL) then we try the alternate version instead. If the alternate version
fails too, then we can return an error code. The suggested fix provided in this
bug report includes the changes I've described here. With the fix in place, I'm
able to load SwingSet2 with the GTK L&F and the widgets (e.g. internal frame
decorations) match my desktop pretty accurately (better than before at least).
not match my native desktop decorations. I'm running the special GNOME 2.0 for
Solaris 9 that was released a couple years ago before JDS existed.
I think I've figured out the cause: in gtk2_interface.c we load all the necessary
GTK function entrypoints via dlsym(). On versions of GTK prior to 2.4 (according
to the code comments), a couple functions may be missing:
gtk_combo_box_new (was called "gtk_combo_new" pre-2.4)
gtk_separator_tool_item_new (was called "gtk_vseparator_new" pre-2.4)
As the code is currently written, we will load all function symbols via dlsym(),
and when finished we call dlerror() to see if there were any problems loading the
symbols. On systems that have old versions of libgtk-x11-2.0.so.0 (like mine, which
has libgtk-x11-2.0.so.0.100.0) dlerror() will report an error because those two
symbols above are not available, even though we made an attempt to dlsym() their
new counterparts (see the comment about "Some functions may be missing...").
Obviously, the code needs to be restructured so that we only call dlerror() after
loading all the required symbols. Then we need to specially handle the two
functions listed above. If the preferred function is not available (i.e. dlsym()
returns NULL) then we try the alternate version instead. If the alternate version
fails too, then we can return an error code. The suggested fix provided in this
bug report includes the changes I've described here. With the fix in place, I'm
able to load SwingSet2 with the GTK L&F and the widgets (e.g. internal frame
decorations) match my desktop pretty accurately (better than before at least).