GNOME Bugzilla – Bug 627455
Fix compilation with deprecations
Last modified: 2011-01-30 09:54:31 UTC
The following patches make gnome-panel compile with GDK_DISABLE_DEPRECATED and -Werror here. (Well, I ignored the bonobo/ dir...) The patches are mostly conversions to Cairo drawing plus some build fixes. I tested them a bit, but of course I don't know the code, so might have missed something obivous.
Created attachment 168353 [details] [review] clock: Fix compile warning without NetworkManager Don't compile a function that was only used by the NM code.
Created attachment 168354 [details] [review] clock: Draw wih Cairo
Created attachment 168355 [details] [review] fish: Achievement unlocked: a face lift in Cairo
Created attachment 168356 [details] [review] background: Remove unused GC
Created attachment 168357 [details] [review] Gegls from outer Egypt Do the gegling with Cairo.
Created attachment 168358 [details] [review] panel: Draw button widget with Cairo
Created attachment 168359 [details] [review] panel: Draw frame widget with Cairo
Created attachment 168360 [details] [review] build: Explicitly link to libXrandr Makes things compile again here.
Could this get a review, please?
Yes, but not now, especially as we're in hard code freeze and this is no real bug fix :-)
Oh, sorry. I thougth gnome-panel was already branched ;)
All these patches are incorporated on the gtk3 branch (I didn't see this bug when I made that, so there was some duplicated work; everything that still was applicable was taken from the patches here).
Is there a tarball release covering these fixes?
No. They don't even work yet, it only compiles. You probably should use panel 2.32.x for now.
vuntz: ping
*** Bug 637480 has been marked as a duplicate of this bug. ***
I'm currently working on updating gnome-panel to build with recent API breaks (size requisition, GTK_WINDOW_XID, etc.). I'll attach patches in the next few days. So you're warned - avoid duplicate work! ;-)
Created attachment 177213 [details] [review] Move widgets to get_preferred_width/height() API instead of size_request() This is how current GTK+3 handles size requisitions. Most of the time, it simply means splitting the function between height and width. When possible, we ask children for minimal and natural sizes, but when it's too complex, we just set minimal_size = natural_size. This raises GTK+ 3 requirement to 2.91.7.
Created attachment 177214 [details] [review] Use GDK_WINDOW_XID instead of deprecated GDK_WINDOW_XWINDOW Required to build with recent GDK3.
Created attachment 177215 [details] [review] Fix includes from libgnome-desktop Path has changed with gnome-desktop 3.0.
Created attachment 177216 [details] [review] Don't include gdkconfig.h No need to include it directly, and it makes the build fail.
Created attachment 177217 [details] [review] Use GtkStateFlags instead of sealed GtkButton fields GTK_STATE_FLAG_ACTIVE means that the button is pressed, and GTK_STATE_FLAG_PRELIGHT that pointer is over it.
Created attachment 177218 [details] [review] Use GdkAppLaunchContext instead of gdk_spawn_command_line_on_screen() The latter has been removed in GDK 3, so use GIO's GAppLaunchContext and GAppInfo.
Created attachment 177219 [details] [review] Use gdk_x11_window_lookup_for_display() instead of gdk_window_lookup() The latter has been removed in GDK 3, use the new X11-specific equivalent.
Created attachment 177220 [details] [review] Adapt to arguments changes in gdk_rgba_parse() and gdk_window_get_geometry() Prototypes for these two functions have changed in GDK 3. gdk_rgba_parse() has swapped color and spec, and gdk_window_get_geometry() has lost it's depth argument.
Created attachment 177221 [details] [review] Remove unused xstuff_net_wm_supports() This function isn't used anywhere and calls gdk_net_wm_supports(), which has been removed in GDK 3. If needed, it could be changed to use gdk_x11_screen_supports_net_wm_hint(), but for now better remove it altogether.
Created attachment 177222 [details] [review] [Temp] Comment out blocks accessing GtkMenuShell internals These blocks need to be ported to something else, but no solution seems to exist in current GTK+ 3. Commenting them out allows the build to succeed.
The port was actually quicker than I thought. I couldn't test my patches since we still need to find a solution for the GtkMenuShell issue (see comment #27). For now, gnome-panel builds with GTK+ 3, but it fails on start. Maybe we could temporarily remove the GtkMenuShell stuff in a clean way so that gnome-panel can be tested, but I'd like to hear from you before that - if we can directly implement the fix, it would be better.
Should have written this on the bug, not just on irc: 23:09 < vuntz> milanbv: ah, won't have time to look at them before next week since I'll be offline soon 23:09 < vuntz> milanbv: but to answer your last comment: I'd just remove the GtkMenuShell stuff that breaks things 23:10 < vuntz> milanbv: also, feel free to push all this to the gtk3 branch 23:10 < vuntz> milanbv: it might help other people
Ah, I just noticed there's a comment about GtkMenuShell at https://bugzilla.gnome.org/show_bug.cgi?id=612481#c11 It seems we need to add functions to GTK+ to do what we want. Not sure what we should do in the meantime...
Review of attachment 177213 [details] [review]: The patch looks fine to me. (Unfortunately, I did not realize you were working on the same patch :( )
Review of attachment 177222 [details] [review]: In this particular patch, it would be good to add some comments, such as FIXME, that can help to catch them later.
Created attachment 177248 [details] [review] Fix libegg according to GDK deprecations Fix build of libegg (gdk)
Review of attachment 177215 [details] [review]: Committed in gtk3
Review of attachment 177216 [details] [review]: Committed in gtk3
Review of attachment 177217 [details] [review]: Committed in gtk3
Review of attachment 177218 [details] [review]: Committed in gtk3
Review of attachment 177219 [details] [review]: Committed in gtk
Review of attachment 177220 [details] [review]: Committed in gtk3
Review of attachment 177221 [details] [review]: Committed in gtk3. FWIW, xstuff is duplicated also in gnome-applets/trashapplet.
Review of attachment 177248 [details] [review]: Committed in gtk3.
Created attachment 177255 [details] [review] Fix gdk_spawn_* by g_spawn_* and GdkApp Use GdkAppLaunchContext instead of gdk_spawn_command_line_on_screen() and use of g_spawn_async instead of gdk_spawn_on_screen(). I also committed it.
Created attachment 177258 [details] [review] Fix gdk_set_sm_client_id deprecated Fix gdk_set_sm_client_id deprecated (replaced by gdk_x11_set_sm_client_id) on panel-session. I already committed it.
Created attachment 177259 [details] [review] Fix gdk_spawn_on_screen deprecated Fix gdk_spawn_on_screen deprecated on panel-launch. (I forgot to include panel-launch in a previous commit :-/ )
Created attachment 177260 [details] [review] Removed gdk_xid_table_lookup_for_display() Removed gdk_xid_table_lookup_for_display() According to the documentatiom, GTK+ only stores windows in its X id table nowadays and the recomendation is to use gdk_x11_window_lookup_for_display() which was already in use. Hence, if the returned value is != NULL then is a window and we can ask to the user to kill the application. I already committed it. With the patch (not committed yet) submitted by Milan (#c27), gnome-panel is compiling again. Now it is time to make it work. Please check if the rationale is ok.
(In reply to comment #33) > Review of attachment 177222 [details] [review]: > > In this particular patch, it would be good to add some comments, > such as FIXME, that can help to catch them later. I don't think we should push that patch commenting out GtkMenuShell uses, it's really ugly, and it just meant to allow finding further build failures. If we commit something that isn't the final solution, it should be clean enough so that gnome-panel runs correctly. OK to push attachment 177214 [details] [review] (use GDK_WINDOW_XID) too?
(In reply to comment #45) > Created an attachment (id=177259) [details] [review] > Fix gdk_spawn_on_screen deprecated > > Fix gdk_spawn_on_screen deprecated on panel-launch. > > (I forgot to include panel-launch in a previous commit :-/ ) Weird, I thought gnome-panel was building fine with my patches, and yet you found other occurrences of gdk_spawn_on_screen()... Anyway, maybe we should merge your patch with my attachment 177218 [details] [review], and don't bother using GdkAppLaunchContext since setting the DISPLAY env var is simpler? About attachment 177260 [details] [review], it seems you forgot gdk_x11_window_lookup_for_display() in the if(). I really can't tell about the rationale, though - I just don't understand what you mean by "gdk_x11_window_lookup_for_display() which was already in use". Finally, I noticed there are a few gdk_rgba_parse() that need their arguments to be swapped, so this will require another rebase of my commits to be clean.
The gtk3 head still doesn't compile, this time with: panel-menu-button.c: In function 'panel_menu_button_menu_deactivated': panel-menu-button.c:352:21: error: 'GtkButton' has no member named '_g_sealed__in_button' I've attached a patch for this (although I don't know if local changes to state_flags propagate as intended). Further compilation also fails with: workspace-switcher.c: In function 'close_dialog': workspace-switcher.c:824:9: error: 'GtkTreeViewColumn' has no member named '_g_sealed__editable_widget' workspace-switcher.c:824:46: error: 'GtkTreeViewColumn' has no member named '_g_sealed__editable_widget' workspace-switcher.c:825:40: error: 'GtkTreeViewColumn' has no member named '_g_sealed__editable_widget'
Created attachment 177269 [details] [review] Use gtk_widget_unset_state_flags in panel_menu.c:346 (panel_menu_button_menu_deactivated) Patch promised in preceding comment
Review of attachment 177269 [details] [review]: Thanks! I've pushed this patch with spacing fixes: you should have used tabs instead of two spaces, and added a space between a function name and parentheses.
(In reply to comment #48) > (In reply to comment #45) > > Created an attachment (id=177259) [details] [review] [details] [review] > > Fix gdk_spawn_on_screen deprecated > > > > Fix gdk_spawn_on_screen deprecated on panel-launch. > > > > (I forgot to include panel-launch in a previous commit :-/ ) > Weird, I thought gnome-panel was building fine with my patches, and yet you > found other occurrences of gdk_spawn_on_screen()... Anyway, maybe we should > merge your patch with my attachment 177218 [details] [review], and don't bother using > GdkAppLaunchContext since setting the DISPLAY env var is simpler? I do not have an opinion here. I would have used GdkAppLaunchContext, but I could not find how to pass it argv and set the environment variable. So, I thought GdkAppLaunchContext was better for gdk_spawn_command_line_on_screen and g_spawn_async was better for gdk_spawn_on_screen. > About attachment 177260 [details] [review], it seems you forgot > gdk_x11_window_lookup_for_display() in the if(). I really can't tell about the > rationale, though - I just don't understand what you mean by > "gdk_x11_window_lookup_for_display() which was already in > use". You are right. I misread gdk_x11_lookup_xdisplay as gdk_x11_window_lookup_for_display, too (it was ~5:00 am ;-) Fixed it gtk3.
(In reply to comment #47) > (In reply to comment #33) > > Review of attachment 177222 [details] [review]: > > > > In this particular patch, it would be good to add some comments, > > such as FIXME, that can help to catch them later. > I don't think we should push that patch commenting out GtkMenuShell uses, it's > really ugly, and it just meant to allow finding further build failures. If we > commit something that isn't the final solution, it should be clean enough so > that gnome-panel runs correctly. Agreed. I was thinking on Vincent's comment (#c29): "23:09 < vuntz> milanbv: but to answer your last comment: I'd just remove the GtkMenuShell stuff that breaks things" However, GtkMenuShell *really* breaks things: - No popup menu in a menu item (to add menu items as launchers) - The same for drag & drop items - Workspace switcher - Window menu > OK to push attachment 177214 [details] [review] (use GDK_WINDOW_XID) too? This is already applied: http://git.gnome.org/browse/gnome-panel/commit/?h=gtk3&id=ec1d200d170d1ab0c4a5081296ea9f082a6cad0d
Review of attachment 177213 [details] [review]: ::: gnome-panel/button-widget.c @@ -427,3 @@ ButtonWidget *button_widget = BUTTON_WIDGET (widget); - if (button_widget->priv->pixbuf) { This condition is necessary, otherwise with no pixbuf the width returned would be -1, producing several warnings. I applied a fix on gtk3: http://git.gnome.org/browse/gnome-panel/commit/?h=gtk3&id=2edaeb4abbc8ec6714aefd1fb83df9011d8a42a5
Review of attachment 177259 [details] [review]: ::: gnome-panel/libpanel-util/panel-launch.c @@ +243,3 @@ + G_SPAWN_SEARCH_PATH, + set_environment, + &display, display should not be passed by reference. I fixed it on gtk3 branch. The same for panel-run-dialog.
Created attachment 177564 [details] [review] Don't access GtkTreeViewColumn->editable_widget directly This member has been sealed. Use gtk_cell_area_get_edit_widget() instead.
With this last patch, all of gnome-panel compiles. Once it's committed how about a quick tarball release so that I can finish compiling 2.91.5 (under garnome)? Thanks to all.
We need to decide what to do with the GtkMenuShell hack before... And then, check that gnome-panel more or less works...
(In reply to comment #58) > We need to decide what to do with the GtkMenuShell hack before... And then, > check that gnome-panel more or less works... we might need accessors for: - GtkMenuShell->active The solution provided in https://bugzilla.gnome.org/show_bug.cgi?id=595496#c17 does not seem that we could apply it here. - GtkMenuShell->active_menu_item - GtkMenuShell->have_grab - GtkMenuShell->parent_menu_shell The bug for this accessors is also in gdm (see ttps://bugzilla.gnome.org/show_bug.cgi?id=612472) and https://bugzilla.gnome.org/show_bug.cgi?id=612481 Current state: - There is no proper height for gnome-menu-bar. When it is loaded in the panel, the panel change its height and it is huge (200px or so). It could be also a problem in the panel that does not restrict to the applets to a maximum size (I think I read a comment written by Vincent on this matter, but I could not find it quickly). - Lacking of parent_menu_shell now means gnome-panel crashes when you delete gnome-menu-bar applet from the panel. - IIU, one of the hacks allows to press F10 and get a menu. I do not remember when was the last time it worked for me. Does it work for any of you on the stable gnome-panel? - The clock map crashes as soon as it tries to be shown.
(In reply to comment #59) > we might need accessors for: Are there bug reports to depend on? See overview in bug 597610...
(In reply to comment #60) > (In reply to comment #59) > > we might need accessors for: > > Are there bug reports to depend on? See overview in bug 597610... Thanks André. I checked them all of them, and only one of them is already reported: GtkMenuShell->active GtkMenuShell->children (I missed this one previously). Nevertheless, I was waiting for some feedback (or idea) before asking for accessors.
(In reply to comment #61) > Nevertheless, I was waiting for some feedback (or idea) before > asking for accessors. We simply don't have time. GTK 2.99 is directly around the corner and expected to be API frozen. Might make sense to talk to gtk+ folks directly.
I can confirm some of the run-time problems mentioned in comment #59. I'd also like to add to Andre's preceding comment: Without a functioning gnome-panel (in particular libpanel-applet) lots of gnome either won't compile or run properly.
(In reply to comment #59) > (In reply to comment #58) > > We need to decide what to do with the GtkMenuShell hack before... And then, > > check that gnome-panel more or less works... > > we might need accessors for: > - GtkMenuShell->active > > The solution provided in > https://bugzilla.gnome.org/show_bug.cgi?id=595496#c17 > does not seem that we could apply it here. > > - GtkMenuShell->active_menu_item Use gtk_menu_shell_get_selected_item() > - GtkMenuShell->parent_menu_shell Use gtk_menu_shell_get_parent_shell() > - GtkMenuShell->children (I missed this one previously). You can use gtk_container_get_children() here
Patch for GtkMenuShell->active here: https://bugzilla.gnome.org/show_bug.cgi?id=597895#c6
Indeed, for GtkMenuShell->have_grab and GtkMenuShell->active , see federico comments in GDM bug: https://bugzilla.gnome.org/show_bug.cgi?id=612472#c11
(In reply to comment #64) > (In reply to comment #59) > > (In reply to comment #58) > > > We need to decide what to do with the GtkMenuShell hack before... And then, > > > check that gnome-panel more or less works... > > > > we might need accessors for: > > - GtkMenuShell->active > > > > The solution provided in > > https://bugzilla.gnome.org/show_bug.cgi?id=595496#c17 > > does not seem that we could apply it here. > > > > - GtkMenuShell->active_menu_item > > Use gtk_menu_shell_get_selected_item() > > > - GtkMenuShell->parent_menu_shell > > Use gtk_menu_shell_get_parent_shell() > [...] Thanks Javier. Now I wonder why I do not get the documentation (neither the prototype) of these functions at http://library.gnome.org/devel/gtk/unstable/GtkMenuShell.html
(In reply to comment #66) > Indeed, for GtkMenuShell->have_grab and GtkMenuShell->active , see federico > comments in GDM bug: https://bugzilla.gnome.org/show_bug.cgi?id=612472#c11 But 2 of the 3 functions used are not available. On the other hand, there is no access to GtkMenuShell->submenu and I could not find accessors in gtk/gtkmenushell.c
(In reply to comment #68) > (In reply to comment #66) > > Indeed, for GtkMenuShell->have_grab and GtkMenuShell->active , see federico > > comments in GDM bug: https://bugzilla.gnome.org/show_bug.cgi?id=612472#c11 > > But 2 of the 3 functions used are not available. > > On the other hand, there is no access to GtkMenuShell->submenu > and I could not find accessors in gtk/gtkmenushell.c Never mind. It should be gtk_menu_item_get_submenu.
Review of attachment 177564 [details] [review]: I applied this patch, but I changed the spaces by tabs I just followed the convention of the function, but it seems there is a mix between tabs and spaces in gnome-panel files.
I committed 3 patches that fixes the following sealed fields: - GtkMenuShell->active_menu_item (->submenu) - GtkMenuShell->parent_menu_shell - GtkMenuShell->children (->data) The missing parts are related to grab/ungrab the focus (keyboard and/or the pointer), which involves the following sealed fields: - GtkMenuShell->have_grab - GtkMenuShell->active and also the deprecated function gdk_pointer_grab. It seems to help the focus in the panel in order to use the keyboard. IMVHO, we could drop the code, get the compilation done properly, fix the crashes, fix the main features works, and open a new bug with this regression. Another alternative is to implement menu_popup using the api available. FWIW, the current code in wcnk (copied from gtkmenubar.c) was introduced to replace the machinery in wnck. See https://bugzilla.gnome.org/review?bug=160450&attachment=35166
My build no longer works with last night's updates. Here's the log: libtool: link: /usr/bin/gcc -I/opt/garnome-svn-2.91.5/include -O2 -g -pipe -DGWEATHER_I_KNOW_THIS_IS_UNSTABLE -Wl,--export-dynamic -o gnome-panel gnome_panel-panel-typebuiltins.o gnome_panel-panel-marshal.o gnome_panel-main.o gnome_panel-panel-widget.o gnome_panel-button-widget.o gnome_panel-xstuff.o gnome_panel-panel-session.o gnome_panel-panel-compatibility.o gnome_panel-panel.o gnome_panel-applet.o gnome_panel-drawer.o gnome_panel-panel-config-global.o gnome_panel-panel-util.o gnome_panel-panel-gconf.o gnome_panel-panel-properties-dialog.o gnome_panel-panel-run-dialog.o gnome_panel-menu.o gnome_panel-panel-context-menu.o gnome_panel-launcher.o gnome_panel-panel-applet-frame.o gnome_panel-panel-applets-manager.o gnome_panel-panel-shell.o gnome_panel-panel-background.o gnome_panel-panel-background-monitor.o gnome_panel-panel-stock-icons.o gnome_panel-panel-action-button.o gnome_panel-panel-menu-bar.o gnome_panel-panel-menu-button.o gnome_panel-panel-menu-items.o gnome_panel-panel-separator.o gnome_panel-panel-recent.o gnome_panel-panel-action-protocol.o gnome_panel-panel-toplevel.o gnome_panel-panel-struts.o gnome_panel-panel-frame.o gnome_panel-panel-xutils.o gnome_panel-panel-multiscreen.o gnome_panel-panel-a11y.o gnome_panel-panel-bindings.o gnome_panel-panel-profile.o gnome_panel-panel-force-quit.o gnome_panel-panel-lockdown.o gnome_panel-panel-addto.o gnome_panel-panel-ditem-editor.o gnome_panel-panel-modules.o gnome_panel-panel-applet-info.o -pthread -Wl,--export-dynamic -L/opt/garnome-svn-2.91.5/lib ../gnome-panel/libegg/.libs/libegg.a -L/lib ../gnome-panel/libpanel-applet-private/.libs/libpanel-applet-private.a ../gnome-panel/libpanel-util/.libs/libpanel-util.a /opt/garnome-svn-2.91.5/lib/libgnome-desktop-3.so /opt/garnome-svn-2.91.5/lib/libstartup-notification-1.so /usr/lib/libSM.so -luuid /usr/lib/libICE.so /opt/garnome-svn-2.91.5/lib/libgconf-2.so /opt/garnome-svn-2.91.5/lib/libORBit-2.so /opt/garnome-svn-2.91.5/lib/libgnome-menu.so /opt/garnome-svn-2.91.5/lib/libcanberra-gtk3.so -L/usr/local/samba/lib /opt/garnome-svn-2.91.5/lib/libcanberra.so /usr/lib/libvorbisfile.so /usr/lib/libvorbis.so /usr/lib/libogg.so -ltdb /opt/garnome-svn-2.91.5/lib/libltdl.so /opt/garnome-svn-2.91.5/lib/libgtk-3.0.so /opt/garnome-svn-2.91.5/lib/libgdk-3.0.so /opt/garnome-svn-2.91.5/lib/libatk-1.0.so /opt/garnome-svn-2.91.5/lib/libpangocairo-1.0.so /opt/garnome-svn-2.91.5/lib/libpangoft2-1.0.so /usr/lib/libstdc++.so /usr/lib/libXinerama.so /usr/lib/libXi.so /usr/lib/libXcursor.so /usr/lib/libXcomposite.so /usr/lib/libXdamage.so /opt/garnome-svn-2.91.5/lib/libgdk_pixbuf-2.0.so /opt/garnome-svn-2.91.5/lib/libcairo-gobject.so /opt/garnome-svn-2.91.5/lib/libgio-2.0.so -lresolv /usr/lib/libXfixes.so /opt/garnome-svn-2.91.5/lib/libcairo.so /usr/lib/libpixman-1.so /usr/lib/libpng12.so /opt/garnome-svn-2.91.5/lib/libpango-1.0.so -lm /opt/garnome-svn-2.91.5/lib/libfontconfig.so /opt/garnome-svn-2.91.5/lib/libfreetype.so -lz /usr/lib/libexpat.so /opt/garnome-svn-2.91.5/lib/libgmodule-2.0.so /opt/garnome-svn-2.91.5/lib/libdbus-glib-1.so /opt/garnome-svn-2.91.5/lib/libdbus-1.so /opt/garnome-svn-2.91.5/lib/libgobject-2.0.so /opt/garnome-svn-2.91.5/lib/libgthread-2.0.so -lpthread /opt/garnome-svn-2.91.5/lib/libglib-2.0.so /opt/garnome-svn-2.91.5/lib/libiconv.so -lrt /usr/lib/libXrandr.so /usr/lib/libXext.so /usr/lib/libXrender.so /usr/lib/libX11.so /usr/lib/libxcb.so /usr/lib/libXdmcp.so -ldl /usr/lib/libXau.so -pthread -Wl,-rpath -Wl,/opt/garnome-svn-2.91.5/lib -Wl,-rpath -Wl,/opt/garnome-svn-2.91.5/lib gnome_panel-menu.o: In function `drag_end_menu_cb': /home/ronis/Project/notar/GNOME/garnome/svn/gnome-panel/work/main.d/gnome-panel-git/gnome-panel/menu.c:1055: undefined reference to `gtk_menu_shell_get_parent_shell' gnome_panel-menu.o: In function `restore_grabs': /home/ronis/Project/notar/GNOME/garnome/svn/gnome-panel/work/main.d/gnome-panel-git/gnome-panel/menu.c:840: undefined reference to `gtk_menu_shell_get_parent_shell' gnome_panel-menu.o: In function `panel_menu_key_press_handler': /home/ronis/Project/notar/GNOME/garnome/svn/gnome-panel/work/main.d/gnome-panel-git/gnome-panel/menu.c:1917: undefined reference to `gtk_menu_shell_get_selected_item' collect2: ld returned 1 exit status
I guess you need to update you GTK+, Germán added these fonctions just yesterday.
I just updated gtk+ to 2.99.0, updated my gnome-panel sources and tried building I now get compile errors: menu.c: In function 'restore_grabs': menu.c:844:50: error: 'GtkMenuShell' has no member named 'GSEAL' menu.c:844:58: error: 'have_xgrab' undeclared (first use in this function) menu.c:844:58: note: each undeclared identifier is reported only once for each function it appears in menu.c:857:33: error: 'GtkMenuShell' has no member named 'GSEAL' menu.c: In function 'drag_end_menu_cb': menu.c:1071:34: error: 'GtkMenuShell' has no member named 'GSEAL' menu.c:1071:42: error: 'have_xgrab' undeclared (first use in this function) make[4]: *** [gnome_panel-menu.o] Error 1 make[4]: Leaving directory `/home/ronis/Project/notar/GNOME/garnome/svn/gnome-panel/work/main.d/gnome-panel-git/gnome-panel' I thought all the gseal's were eliminated? Is my repository corrupted?
They haven't - they were only commented out with my ugly patch (attachment 177222 [details] [review]). See comments above.
(In reply to comment #74) > I just updated gtk+ to 2.99.0, updated my gnome-panel sources and tried > building > > I now get compile errors: > [...] > I thought all the gseal's were eliminated? Is my repository corrupted? No, according to my comment (c#71) those are still pending. There are 3 files involved: - applets/wncklet/window-menu.c - gnome-panel/menu.c - gnome-panel/panel-menu-bar.c Also, I found the explanation for F10 and grabbing the focus. This is still an issue with stable gnome-panel: https://bugzilla.gnome.org/show_bug.cgi?id=99297
Created attachment 177733 [details] [review] Fix use of deprecated gdk_app_launch_context_new()
Created attachment 177735 [details] [review] Fix use of deprecated gtk_widget_get_child_requisition()
Created attachment 177736 [details] [review] Fix use of deprecated gdk_cursor_unref
Created attachment 177738 [details] [review] Fix use of deprecated gtk_widget_size_request()
The list of pending functions to be migrated. Please, note that g_completion_* is marked as deprecated, but there is no replacement and -AFAIU- Glib will not break the API/ABI stability. So, it is ok to have g_completion_* panel-widget.c: In function ‘panel_widget_style_set’: panel-widget.c:1594: warning: implicit declaration of function ‘gtk_widget_get_style’ panel-widget.c:1594: warning: nested extern declaration of ‘gtk_widget_get_style’ panel-widget.c:1594: warning: assignment makes pointer from integer without a cast panel-widget.c: In function ‘panel_widget_state_changed’: panel-widget.c:1612: warning: assignment makes pointer from integer without a cast panel-widget.c: In function ‘panel_widget_realize’: panel-widget.c:1646: warning: assignment makes pointer from integer without a cast panel-widget.c: In function ‘panel_widget_applet_drag_start’: panel-widget.c:1907: warning: implicit declaration of function ‘gdk_pointer_grab’ panel-widget.c:1907: warning: nested extern declaration of ‘gdk_pointer_grab’ panel-widget.c: In function ‘panel_widget_applet_drag_end’: panel-widget.c:1929: warning: implicit declaration of function ‘gdk_pointer_ungrab’ panel-widget.c:1929: warning: nested extern declaration of ‘gdk_pointer_ungrab’ button-widget.c: In function ‘button_widget_reload_pixbuf’: button-widget.c:177: warning: implicit declaration of function ‘gtk_widget_render_icon’ button-widget.c:177: warning: nested extern declaration of ‘gtk_widget_render_icon’ button-widget.c:179: warning: assignment makes pointer from integer without a cast button-widget.c: In function ‘button_widget_draw’: button-widget.c:374: warning: implicit declaration of function ‘gtk_widget_get_style’ button-widget.c:374: warning: nested extern declaration of ‘gtk_widget_get_style’ button-widget.c:374: warning: assignment makes pointer from integer without a cast button-widget.c:384: warning: implicit declaration of function ‘gtk_paint_arrow’ button-widget.c:384: warning: nested extern declaration of ‘gtk_paint_arrow’ button-widget.c:415: warning: implicit declaration of function ‘gtk_paint_focus’ button-widget.c:415: warning: nested extern declaration of ‘gtk_paint_focus’ panel-util.c: In function ‘panel_make_unique_desktop_uri’: panel-util.c:673: warning: ignoring return value of ‘strtol’, declared with attribute warn_unused_result panel-run-dialog.c: In function ‘panel_run_dialog_destroy’: panel-run-dialog.c:240: warning: implicit declaration of function ‘g_completion_free’ panel-run-dialog.c:240: warning: nested extern declaration of ‘g_completion_free’ panel-run-dialog.c: In function ‘panel_run_dialog_update_completion’: panel-run-dialog.c:1445: warning: implicit declaration of function ‘g_completion_new’ panel-run-dialog.c:1445: warning: nested extern declaration of ‘g_completion_new’ panel-run-dialog.c:1445: warning: assignment makes pointer from integer without a cast panel-run-dialog.c:1495: warning: implicit declaration of function ‘g_completion_add_items’ panel-run-dialog.c:1495: warning: nested extern declaration of ‘g_completion_add_items’ panel-run-dialog.c: In function ‘entry_event’: panel-run-dialog.c:1573: warning: implicit declaration of function ‘g_completion_complete_utf8’ panel-run-dialog.c:1573: warning: nested extern declaration of ‘g_completion_complete_utf8’ menu.c: In function ‘drag_end_menu_cb’: menu.c:1064: warning: implicit declaration of function ‘gdk_pointer_grab’ menu.c:1064: warning: nested extern declaration of ‘gdk_pointer_grab’ menu.c:1070: warning: implicit declaration of function ‘gdk_keyboard_grab’ menu.c:1070: warning: nested extern declaration of ‘gdk_keyboard_grab’ menu.c:1076: warning: implicit declaration of function ‘gdk_pointer_ungrab’ menu.c:1076: warning: nested extern declaration of ‘gdk_pointer_ungrab’ panel-applet-frame.c: In function ‘panel_applet_frame_draw’: panel-applet-frame.c:120: warning: implicit declaration of function ‘gtk_paint_handle’ panel-applet-frame.c:120: warning: nested extern declaration of ‘gtk_paint_handle’ panel-applet-frame.c:120: warning: implicit declaration of function ‘gtk_widget_get_style’ panel-applet-frame.c:120: warning: nested extern declaration of ‘gtk_widget_get_style’ panel-applet-frame.c: In function ‘panel_applet_frame_button_changed’: panel-applet-frame.c:387: warning: implicit declaration of function ‘gdk_pointer_ungrab’ panel-applet-frame.c:387: warning: nested extern declaration of ‘gdk_pointer_ungrab’ panel-background.c: In function ‘panel_background_set_no_background_on_widget’: panel-background.c:982: warning: implicit declaration of function ‘gtk_widget_set_style’ panel-background.c:982: warning: nested extern declaration of ‘gtk_widget_set_style’ panel-background.c:983: warning: implicit declaration of function ‘gtk_rc_style_new’ panel-background.c:983: warning: nested extern declaration of ‘gtk_rc_style_new’ panel-background.c:983: warning: assignment makes pointer from integer without a cast panel-background.c:984: warning: implicit declaration of function ‘gtk_widget_modify_style’ panel-background.c:984: warning: nested extern declaration of ‘gtk_widget_modify_style’ panel-background.c: In function ‘panel_background_set_color_background_on_widget’: panel-background.c:1052: warning: implicit declaration of function ‘gtk_widget_modify_bg’ panel-background.c:1052: warning: nested extern declaration of ‘gtk_widget_modify_bg’ panel-background.c: In function ‘get_composited_pattern’: panel-background.c:279: warning: ‘pattern’ may be used uninitialized in this function panel-background-monitor.c: In function ‘panel_background_monitor_get_region’: panel-background-monitor.c:406: warning: ‘pwidth’ may be used uninitialized in this function panel-background-monitor.c:406: note: ‘pwidth’ was declared here panel-background-monitor.c:406: warning: ‘pheight’ may be used uninitialized in this function panel-background-monitor.c:406: note: ‘pheight’ was declared here panel-menu-bar.c: In function ‘panel_menu_bar_class_init’: panel-menu-bar.c:298: warning: implicit declaration of function ‘gtk_rc_parse_string’ panel-menu-bar.c:298: warning: nested extern declaration of ‘gtk_rc_parse_string’ panel-menu-bar.c: In function ‘panel_menu_bar_on_draw’: panel-menu-bar.c:315: warning: implicit declaration of function ‘gtk_paint_focus’ panel-menu-bar.c:315: warning: nested extern declaration of ‘gtk_paint_focus’ panel-menu-bar.c:315: warning: implicit declaration of function ‘gtk_widget_get_style’ panel-menu-bar.c:315: warning: nested extern declaration of ‘gtk_widget_get_style’ panel-separator.c: In function ‘panel_separator_draw’: panel-separator.c:57: warning: implicit declaration of function ‘gtk_widget_get_style’ panel-separator.c:57: warning: nested extern declaration of ‘gtk_widget_get_style’ panel-separator.c:57: warning: assignment makes pointer from integer without a cast panel-separator.c:62: warning: implicit declaration of function ‘gtk_paint_vline’ panel-separator.c:62: warning: nested extern declaration of ‘gtk_paint_vline’ panel-separator.c:69: warning: implicit declaration of function ‘gtk_paint_hline’ panel-separator.c:69: warning: nested extern declaration of ‘gtk_paint_hline’ panel-toplevel.c: In function ‘panel_toplevel_begin_grab_op’: panel-toplevel.c:502: warning: implicit declaration of function ‘gdk_pointer_grab’ panel-toplevel.c:502: warning: nested extern declaration of ‘gdk_pointer_grab’ panel-toplevel.c:508: warning: implicit declaration of function ‘gdk_keyboard_grab’ panel-toplevel.c:508: warning: nested extern declaration of ‘gdk_keyboard_grab’ panel-toplevel.c: In function ‘panel_toplevel_end_grab_op’: panel-toplevel.c:526: warning: implicit declaration of function ‘gdk_pointer_ungrab’ panel-toplevel.c:526: warning: nested extern declaration of ‘gdk_pointer_ungrab’ panel-toplevel.c:527: warning: implicit declaration of function ‘gdk_keyboard_ungrab’ panel-toplevel.c:527: warning: nested extern declaration of ‘gdk_keyboard_ungrab’ panel-toplevel.c: In function ‘panel_toplevel_contains_pointer’: panel-toplevel.c:1354: warning: implicit declaration of function ‘gdk_display_get_pointer’ panel-toplevel.c:1354: warning: nested extern declaration of ‘gdk_display_get_pointer’ panel-toplevel.c: In function ‘panel_toplevel_update_position’: panel-toplevel.c:2275: warning: implicit declaration of function ‘gtk_widget_get_style’ panel-toplevel.c:2275: warning: nested extern declaration of ‘gtk_widget_get_style’ panel-toplevel.c:2275: warning: assignment makes pointer from integer without a cast panel-toplevel.c: In function ‘calculate_minimum_height’: panel-toplevel.c:2317: warning: assignment makes pointer from integer without a cast panel-toplevel.c: In function ‘panel_toplevel_update_size’: panel-toplevel.c:2442: warning: assignment makes pointer from integer without a cast panel-toplevel.c: In function ‘panel_toplevel_size_allocate’: panel-toplevel.c:3152: warning: assignment makes pointer from integer without a cast panel-toplevel.c: In function ‘panel_toplevel_draw’: panel-toplevel.c:3216: warning: assignment makes pointer from integer without a cast panel-toplevel.c:3242: warning: implicit declaration of function ‘gtk_paint_handle’ panel-toplevel.c:3242: warning: nested extern declaration of ‘gtk_paint_handle’ panel-frame.c: In function ‘panel_frame_get_preferred_width’: panel-frame.c:47: warning: implicit declaration of function ‘gtk_widget_get_style’ panel-frame.c:47: warning: nested extern declaration of ‘gtk_widget_get_style’ panel-frame.c:47: warning: assignment makes pointer from integer without a cast panel-frame.c: In function ‘panel_frame_get_preferred_height’: panel-frame.c:79: warning: assignment makes pointer from integer without a cast panel-frame.c: In function ‘panel_frame_size_allocate’: panel-frame.c:117: warning: assignment makes pointer from integer without a cast panel-frame.c: In function ‘panel_frame_draw’: panel-frame.c:172: warning: assignment makes pointer from integer without a cast panel-xutils.c: In function ‘panel_xutils_set_window_type’: panel-xutils.c:84: warning: ignoring return value of ‘gdk_error_trap_pop’, declared with attribute warn_unused_result panel-xutils.c: In function ‘panel_xutils_set_strut’: panel-xutils.c:153: warning: ignoring return value of ‘gdk_error_trap_pop’, declared with attribute warn_unused_result panel-xutils.c: In function ‘panel_warp_pointer’: panel-xutils.c:171: warning: ignoring return value of ‘gdk_error_trap_pop’, declared with attribute warn_unused_result panel-force-quit.c: In function ‘remove_popup’: panel-force-quit.c:110: warning: implicit declaration of function ‘gdk_pointer_ungrab’ panel-force-quit.c:110: warning: nested extern declaration of ‘gdk_pointer_ungrab’ panel-force-quit.c:111: warning: implicit declaration of function ‘gdk_keyboard_ungrab’ panel-force-quit.c:111: warning: nested extern declaration of ‘gdk_keyboard_ungrab’ panel-force-quit.c: In function ‘kill_window_response’: panel-force-quit.c:197: warning: ignoring return value of ‘gdk_error_trap_pop’, declared with attribute warn_unused_result panel-force-quit.c: In function ‘panel_force_quit’: panel-force-quit.c:299: warning: implicit declaration of function ‘gdk_pointer_grab’ panel-force-quit.c:299: warning: nested extern declaration of ‘gdk_pointer_grab’ panel-force-quit.c:308: warning: implicit declaration of function ‘gdk_keyboard_grab’ panel-force-quit.c:308: warning: nested extern declaration of ‘gdk_keyboard_grab’ panel-util.c: In function ‘panel_make_unique_desktop_uri’: panel-util.c:673: warning: ignoring return value of ‘strtol’, declared with attribute warn_unused_result panel-applet.c: In function ‘panel_applet_button_event’: panel-applet.c:1068: warning: implicit declaration of function ‘gdk_display_pointer_ungrab’ panel-applet.c:1068: warning: nested extern declaration of ‘gdk_display_pointer_ungrab’ panel-applet.c: In function ‘panel_applet_draw’: panel-applet.c:1292: warning: implicit declaration of function ‘gtk_paint_focus’ panel-applet.c:1292: warning: nested extern declaration of ‘gtk_paint_focus’ panel-applet.c:1292: warning: implicit declaration of function ‘gtk_widget_get_style’ panel-applet.c:1292: warning: nested extern declaration of ‘gtk_widget_get_style’ panel-applet.c: In function ‘panel_applet_update_background_for_widget’: panel-applet.c:1539: warning: implicit declaration of function ‘gtk_widget_set_style’ panel-applet.c:1539: warning: nested extern declaration of ‘gtk_widget_set_style’ panel-applet.c:1540: warning: implicit declaration of function ‘gtk_rc_style_new’ panel-applet.c:1540: warning: nested extern declaration of ‘gtk_rc_style_new’ panel-applet.c:1540: warning: assignment makes pointer from integer without a cast panel-applet.c:1541: warning: implicit declaration of function ‘gtk_widget_modify_style’ panel-applet.c:1541: warning: nested extern declaration of ‘gtk_widget_modify_style’ panel-applet.c:1558: warning: implicit declaration of function ‘gtk_widget_modify_bg’ panel-applet.c:1558: warning: nested extern declaration of ‘gtk_widget_modify_bg’ panel-applet.c:1573: warning: implicit declaration of function ‘gtk_style_copy’ panel-applet.c:1573: warning: nested extern declaration of ‘gtk_style_copy’ panel-applet.c:1573: warning: assignment makes pointer from integer without a cast panel-applet-gconf.h:76: Warning: PanelApplet: panel_applet_gconf_get_list: return value: Missing (transfer) annotation panel-applet.h:121: Warning: PanelApplet: panel_applet_factory_main: argument callback: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async) clock.c: In function ‘calculate_minimum_height’: clock.c:395: warning: implicit declaration of function ‘gtk_widget_get_style’ clock.c:395: warning: nested extern declaration of ‘gtk_widget_get_style’ clock.c:395: warning: assignment makes pointer from integer without a cast clock.c: In function ‘force_no_focus_padding’: clock.c:1298: warning: implicit declaration of function ‘gtk_rc_parse_string’ clock.c:1298: warning: nested extern declaration of ‘gtk_rc_parse_string’ clock.c: At top level: clock.c:203: warning: ‘clock_numbers’ defined but not used clock-map.c: In function ‘clock_map_draw’: clock-map.c:231: warning: implicit declaration of function ‘gtk_widget_get_style’ clock-map.c:231: warning: nested extern declaration of ‘gtk_widget_get_style’ clock-map.c:231: warning: assignment makes pointer from integer without a cast fixedtip.c: In function ‘na_fixed_tip_draw’: fixedtip.c:62: warning: implicit declaration of function ‘gtk_paint_flat_box’ fixedtip.c:62: warning: nested extern declaration of ‘gtk_paint_flat_box’ fixedtip.c:62: warning: implicit declaration of function ‘gtk_widget_get_style’ fixedtip.c:62: warning: nested extern declaration of ‘gtk_widget_get_style’ main.c: In function ‘force_no_focus_padding’: main.c:271: warning: implicit declaration of function ‘gtk_rc_parse_string’ main.c:271: warning: nested extern declaration of ‘gtk_rc_parse_string’ window-menu.c: In function ‘window_menu_on_draw’: window-menu.c:123: warning: implicit declaration of function ‘gtk_paint_focus’ window-menu.c:123: warning: nested extern declaration of ‘gtk_paint_focus’ window-menu.c:123: warning: implicit declaration of function ‘gtk_widget_get_style’ window-menu.c:123: warning: nested extern declaration of ‘gtk_widget_get_style’ window-menu.c: In function ‘force_no_focus_padding’: window-menu.c:140: warning: implicit declaration of function ‘gtk_rc_parse_string’ window-menu.c:140: warning: nested extern declaration of ‘gtk_rc_parse_string’ showdesktop.c: In function ‘update_icon’: showdesktop.c:156: warning: implicit declaration of function ‘gtk_widget_get_style’ showdesktop.c:156: warning: nested extern declaration of ‘gtk_widget_get_style’ showdesktop.c:156: warning: assignment makes pointer from integer without a cast showdesktop.c: In function ‘show_desktop_applet_fill’: showdesktop.c:448: warning: implicit declaration of function ‘gtk_rc_parse_string’ showdesktop.c:448: warning: nested extern declaration of ‘gtk_rc_parse_string’
Created attachment 177800 [details] [review] Fix use of deprecated gdk_display_get_pointer()
Created attachment 177801 [details] [review] Fix use of deprecated gdk_display_pointer_ungrab()
Created attachment 177808 [details] [review] Fix use of deprecated gdk_pointer_grab()/_ungrab()
The list of pending deprecated functions has been reduced to: ‘gdk_keyboard_grab’ menu.c:1070: ‘gdk_keyboard_grab’ panel-force-quit.c:308: ‘gdk_keyboard_grab’ panel-toplevel.c:508: ‘gdk_keyboard_ungrab’ panel-force-quit.c:111: ‘gdk_keyboard_ungrab’ panel-toplevel.c:527: ‘gtk_paint_arrow’ button-widget.c:384: ‘gtk_paint_flat_box’ fixedtip.c:62: ‘gtk_paint_focus’ button-widget.c:415: ‘gtk_paint_focus’ panel-applet.c:1292: ‘gtk_paint_focus’ panel-menu-bar.c:315: ‘gtk_paint_focus’ window-menu.c:123: ‘gtk_paint_handle’ panel-applet-frame.c:120: ‘gtk_paint_handle’ panel-toplevel.c:3242: ‘gtk_paint_hline’ panel-separator.c:69: ‘gtk_paint_vline’ panel-separator.c:62: ‘gtk_rc_parse_string’ clock.c:1298: ‘gtk_rc_parse_string’ main.c:271: ‘gtk_rc_parse_string’ panel-menu-bar.c:298: ‘gtk_rc_parse_string’ showdesktop.c:448: ‘gtk_rc_parse_string’ window-menu.c:140: ‘gtk_rc_style_new’ panel-applet.c:1540: ‘gtk_rc_style_new’ panel-background.c:983: ‘gtk_style_copy’ panel-applet.c:1573: ‘gtk_widget_get_style’ button-widget.c:374: ‘gtk_widget_get_style’ clock-map.c:231: ‘gtk_widget_get_style’ clock.c:395: ‘gtk_widget_get_style’ fixedtip.c:62: ‘gtk_widget_get_style’ panel-applet-frame.c:120: ‘gtk_widget_get_style’ panel-applet.c:1292: ‘gtk_widget_get_style’ panel-frame.c:47: ‘gtk_widget_get_style’ panel-menu-bar.c:315: ‘gtk_widget_get_style’ panel-separator.c:57: ‘gtk_widget_get_style’ panel-toplevel.c:2275: ‘gtk_widget_get_style’ panel-widget.c:1594: ‘gtk_widget_get_style’ showdesktop.c:156: ‘gtk_widget_get_style’ window-menu.c:123: ‘gtk_widget_modify_bg’ panel-applet.c:1558: ‘gtk_widget_modify_bg’ panel-background.c:1052: ‘gtk_widget_modify_style’ panel-applet.c:1541: ‘gtk_widget_modify_style’ panel-background.c:984: ‘gtk_widget_render_icon’ button-widget.c:177: ‘gtk_widget_set_style’ panel-applet.c:1539: ‘gtk_widget_set_style’ panel-background.c:982:
Created attachment 177814 [details] [review] Fix use of pending deprecated gdk_pointer_grab()/_ungrab()
I'm currently working on the gtk_widget_get_style() removal, let's avoid duplicate work (again).
Created attachment 177921 [details] [review] Port to GtkStyleContext Most changes consist in using 'padding' and 'border-width' properties instead of GtkStyle::xthickness/ythickness. Use GtkWidget::style-updated signal to replace style-set. Replace GdkColors with GdkRGBA. Remove use of gtk_paint_*() functions in favor of gtk_render_*().
Comment on attachment 177921 [details] [review] Port to GtkStyleContext Above is a first attempt to switch to GtkStyleContext. As usual, not tested beyond building, and it still lacks a proper migration of the background handling, which seems to be quite messy currently. Germán, if you want to give it a try... ;-) For now, I stop.
Review of attachment 177921 [details] [review]: The are problems to run it. I did not have enough time to figure out the problem, though. Too many warnings complaining that PanelFrame does not have the properties "padding", later "border-with". Similar situation for PanelToplevel: "font", "padding"... According the documentation, "padding" is not a property in the hierarchy of PanelToplevel (GtkWindow), neither in PanelFrame (GtkBin). However, "border-width" is a style property of GtkContainer, which is parent of GtkWindow and GtkBin, and it fails there, too.
(In reply to comment #91) > Review of attachment 177921 [details] [review]: > > The are problems to run it. I did not have enough time to > figure out the problem, though. > > Too many warnings complaining that PanelFrame does not have > the properties "padding", later "border-with". > > Similar situation for PanelToplevel: "font", "padding"... > > According the documentation, "padding" is not a property in > the hierarchy of PanelToplevel (GtkWindow), neither in > PanelFrame (GtkBin). However, "border-width" is a style > property of GtkContainer, which is parent of GtkWindow and > GtkBin, and it fails there, too. Well, "border-width" is just a property and not a style property.
(In reply to comment #88) > Created an attachment (id=177921) [details] [review] > Port to GtkStyleContext > > Most changes consist in using 'padding' and 'border-width' properties > instead of GtkStyle::xthickness/ythickness. Use GtkWidget::style-updated > signal to replace style-set. Replace GdkColors with GdkRGBA. Remove > use of gtk_paint_*() functions in favor of gtk_render_*(). FYI, I have pushed a commit that fixes the build with GSEAL. So, you will have to rebase the patch. However, there is no conflict at all. OTOH, I wonder if style-updated may be used to replace 'size_request' http://git.gnome.org/browse/gnome-panel/tree/gnome-panel/menu.c?h=gtk3#n1226
(In reply to comment #92) > (In reply to comment #91) > > Review of attachment 177921 [details] [review] [details]: > > > > The are problems to run it. I did not have enough time to > > figure out the problem, though. > > > > Too many warnings complaining that PanelFrame does not have > > the properties "padding", later "border-with". > > > > Similar situation for PanelToplevel: "font", "padding"... > > > > According the documentation, "padding" is not a property in > > the hierarchy of PanelToplevel (GtkWindow), neither in > > PanelFrame (GtkBin). However, "border-width" is a style > > property of GtkContainer, which is parent of GtkWindow and > > GtkBin, and it fails there, too. > > Well, "border-width" is just a property and not a style > property. Well, there are GtkStyleContext::padding and ::border-width, plus GtkContainer::border-width, which we need to take both into account. But here, I think the problem comes from GtkStyleContext. The first warning is gtkstylecontext.c:2484: widget class `PanelFrame' has no style property named `padding' And indeed, GtkBin doesn't seem to use GtkStyleContext at all, which means PanelFrame doesn't inherit them. But since it doesn't use GtkStyle either, I guess GtkBin isn't supposed to be themed, since it makes little sense to have a common padding for its very different uses (e.g. GtkButton will have its own padding). I'll ask Carlos, and if that's the case, we'll either use fixed values as suited, or add a custom PanelFrame class with default values (but I don't think many people want to theme the panel...). For the font, I'm not sure where we should get it from. GtkWidget itself is getting it from its GtkStyleContext, so it should definitely be OK in PanelFrame too...
(In reply to comment #94) > Well, there are GtkStyleContext::padding and ::border-width, plus > GtkContainer::border-width, which we need to take both into account. But here, > I think the problem comes from GtkStyleContext. > > The first warning is > gtkstylecontext.c:2484: widget class `PanelFrame' has no style property named > `padding' There is a small misconception here, the patch is probably using gtk_widget_style_get(), or a similar function, that function checks the style properties installed through gtk_widget_class_install_style_property(), as GTK+ 2.x has been doing. GtkStyleContext however offers properties that match the CSS syntax ("padding" being one of them), these are to be retrieved with gtk_style_context_get() or the other helper getters. Both things end up being modifiable in CSS files, but following somewhat different code paths, and syntax (being style properties offered as "-WidgetName-style-prop-name") > > And indeed, GtkBin doesn't seem to use GtkStyleContext at all, which means > PanelFrame doesn't inherit them. But since it doesn't use GtkStyle either, I > guess GtkBin isn't supposed to be themed, since it makes little sense to have a > common padding for its very different uses (e.g. GtkButton will have its own > padding). Yeah, GtkBin itself has little to do with padding, its implementations which get to choose how much size to request/allocate, and it's completely up to them how to do that and whether to follow "guidelines" (a container may also ignore GtkContainer::border-width for example) > > I'll ask Carlos, and if that's the case, we'll either use fixed values as > suited, or add a custom PanelFrame class with default values (but I don't think > many people want to theme the panel...). > > For the font, I'm not sure where we should get it from. GtkWidget itself is > getting it from its GtkStyleContext, so it should definitely be OK in > PanelFrame too... Yes, gtk_style_context_get_font() should be it
Created attachment 178096 [details] [review] Port to GtkStyleContext Most changes consist in using 'padding' and 'border-width' properties instead of GtkStyle::xthickness/ythickness. Use GtkWidget::style-updated signal to replace style-set. Replace GdkColors with GdkRGBA. Remove use of gtk_paint_*() functions in favor of gtk_render_*().
Created attachment 178100 [details] [review] Port to GtkStyleContext Most changes consist in using 'padding' and 'border-width' properties instead of GtkStyle::xthickness/ythickness. Use GtkWidget::style-updated signal to replace style-set. Replace GdkColors with GdkRGBA. Remove use of gtk_paint_*() functions in favor of gtk_render_*().
I'm attaching a new patch fixing the warnings, a mem leak, and which actually draws the applets background. As the background wasn't correctly drawn for the right part of the panel before my patch, I couldn't test it (plus, see below). With my patch, size allocation seems to work worse as before, but I don't know why since it don't really change it (except for padding/border, but that only affects a few pixels). Maybe it broke something in that part of the code, need to find where. The panel doesn't always appear, and when it does, it takes half or even the whole height of the screen. Help appreciated! ;-) About the "size_request" signal in gnome-panel/menu.c, I'm not sure what we can do. I don't really understand why the code wasn't using gtk_widget_set_size_request() instead of connecting to the signal. Anyway, we would have to copy how gtk_menu_item_get_preferred_height(), since it has been changed, which is at least one of the reasons why it doesn't work now. But maybe there's a better solution. I don't see how you'd like to replace it with "style-updated". How would you set the size then?
Created attachment 178463 [details] [review] Port to GtkStyleContext Most changes consist in using 'padding' and 'border-width' properties instead of GtkStyle::xthickness/ythickness. Use GtkWidget::style-updated signal to replace style-set. Replace GdkColors with GdkRGBA. Remove use of gtk_paint_*() functions in favor of gtk_render_*().
Comment on attachment 178100 [details] [review] Port to GtkStyleContext New patch fixes the wrong size of the panel (I was using width for the height...), plus many wrong uses of gtk_style_context_get(): this function should take a pointer to GtkBorders, which need to be freed. Use accessors instead. Now the panel is in a much better shape, but there are still a few issues with the background of the menu bar (the rest works). We also need to figure out what to do with all this background code I don't completely understand. In particular, we need to find a way to reset the background to its default value that doesn't involve GtkStyle. There's also a border around the menu bar which should be removed, but that shouldn't be too hard.
Review of attachment 178463 [details] [review]: Using Splinter to discuss my own code's flaws... ::: gnome-panel/panel-widget.c @@ +1593,3 @@ + gtk_widget_get_state_flags (widget), + "background-color", &bg_color, + "background-image", &bg_image, This part is wrong because we never override the background in GtkStyleContext: this means we always draw the default background for this widget. See also how panel_background_set_default_style() doesn't affect GtkStyleContext. We should either let the style context as it is by default, skipping it when the prefs say we should; or modify it correclty, and always draw the background we get from it. But don't mix both solutions... Problem: I haven't found out how we can change the background image in the style context, just like gtk_widget_override_background() does for color.
Review of attachment 178463 [details] [review]: There are several parts that looks ok to commit. I suggest to split this patch in small chunks (per module/applet or functions involved), and leave the ones like drawing the background isolated. For instance, menu.c is a unit, the same for clock, calendar-window, etc. Another thing I notices, the minimum height for the panel now is 25 instead of 24. Nevertheless, it is quite a step forward in comparison with the first attempt (thanks a lot!). I vote for splitting the patch in chunks. ::: gnome-panel/menu.c @@ +1256,3 @@ + req_height += padding.top + padding.bottom + border.top + border.bottom; + gtk_widget_set_size_request (menuitem, 0, req_height); + * This is a bit ugly, since we should keep this in sync with what's in I think the code above is sufficient. The log says: $ git log 1e4a5c8d [...] (image_menuitem_size_request): impl hack to make sure menu items without images are the same height as ones with images. As far as I see, the code above does that. I also tested it adding extra menu items (under Places). ::: gnome-panel/panel-background.c @@ +1034,3 @@ } + gtk_widget_override_background_color (widget, GTK_STATE_NORMAL, color); Here, we are not changing anything at all. I think you mean this part in your comment. ::: gnome-panel/panel-frame.c @@ +215,2 @@ x = y = 0; + gtk_style_context_get_border (style, gtk_widget_get_state_flags (widget), &border); Here we could have the same issue than above (using border instead xthickness). OTOH, this code is based on gtk_default_draw_shadow (gtk/gtkstyle.c), which now use gtk_render_frame. Perhaps it worths to take a look at it. ::: gnome-panel/panel-toplevel.c @@ +2289,2 @@ background = &toplevel->priv->panel_widget->background; /* There's no bevels with a color/image background */ IIUU, we should not have bevels, but currently we have for buttons (applet window selector and custom menu bar). @@ +3222,2 @@ if (toplevel->priv->edges & PANEL_EDGE_RIGHT) + challoc.width -= padding.right + border.right; IIUC, padding.right + border.right == padding.left + border.right. (or it should be). I wonder if we should define only one value above, such as: ythickness = padding.right + border.right xthickness = padding.top + border.top It would be the code less prone to errors and it would look like like the original one.
Milan, Carlos applied several commits into gtk3 brancn fixing several #FIXMEchpe. Some parts of your patch are obsoleted now and the other ones should be rebased.
I'm sorry, I didn't know this patch existed :-(, I think it would be better to open new bug reports for new patches instead of adding more attachments to this bug.
Comment on attachment 178463 [details] [review] Port to GtkStyleContext Indeed, that's what I suspected when I discovered your patches this morning when trying to rebase... :-/ You seem to have fixed all the problems I had with my patch, but doing the boring work twice is sad... Not sure about opening new reports: people that care about the GTK3 port are subscribed here, and I for one am not subscribed to all gnome-panel bugs.
In case you decide to use new reports, please set the GNOME target field to 3.0.
(In reply to comment #105) > (From update of attachment 178463 [details] [review]) > Indeed, that's what I suspected when I discovered your patches this morning > when trying to rebase... :-/ I'm sorry, I thought nobody was working on it. > Not sure about opening new reports: people that care about the GTK3 port are > subscribed here, and I for one am not subscribed to all gnome-panel bugs. Fair enough, I'm now in the CC too.
Just an update: The missing symbols to fix the compilation are: ‘gdk_keyboard_grab’ menu.c:1087: ‘gtk_widget_reset_style’ panel-background.c:992: ‘gdk_keyboard_grab’ panel-toplevel.c:518: ‘gdk_keyboard_ungrab’ panel-toplevel.c:544: ‘gdk_keyboard_ungrab’ panel-force-quit.c:119: ‘gdk_keyboard_grab’ panel-force-quit.c:328: ‘gtk_widget_reset_style’ panel-applet.c:1530: ‘gtk_widget_get_style’ clock.c:293: ‘gtk_rc_parse_string’ clock.c:1297: ‘gtk_widget_get_style’ clock.c:395: ‘gtk_rc_parse_string’ clock.c:1298: ‘gtk_widget_get_style’ clock-map.c:231: ‘gtk_widget_get_style’ showdesktop.c:156:
(In reply to comment #108) > Just an update: > > The missing symbols to fix the compilation are: > > ‘gtk_widget_reset_style’ panel-background.c:992: > ‘gtk_widget_reset_style’ panel-applet.c:1530: I could not find a replacement for gtk_widget_reset_style() and later I realized it is not deprecated anymore: http://git.gnome.org/browse/gtk+/commit/?id=10b6afa1f597a201fb24f3d513aaddab51889812 At least in http://git.gnome.org/browse/gtk+/tree/gtk/gtkwidget.c?id=10b6afa1f597a201fb24f3d513aaddab51889812#n8931 does not look deprecated anymore.
Now it is possible to build gnome-panel with --enable-deprecation-flags. The missing symbols are related to g_completion_*, but it is not a big deal, Glib will not drop the symbols and there is no replacement for g_completion_*. In the worst case, the code of g_completion_* should be included in gnome-panel. Therefore, I am closing this bug.