GNOME Bugzilla – Bug 627490
Compile with -DGDK_DISABLE_DEPRECATED and -Werror
Last modified: 2011-11-17 20:07:34 UTC
The attached series of patches fixes various issues that are required to make gnome-applets compile with -DGDK_DISABLE_DEPRECATED and -Werror. This is mostly porting rendering code to Cairo, but also includes small patches fixing gcc complaints. My usual disclaimer: I tested the various patches, but as it's not my code, I might have missed something.
Created attachment 168390 [details] [review] cpufreq: Link to dbus-glib
Created attachment 168391 [details] [review] drivemount: Fix "variable might be used uninitialized" The code used to set a broken screen in an error case.
Created attachment 168392 [details] [review] stickynotes: Fix compile warnings
Created attachment 168393 [details] [review] trash: Remove unused function
Created attachment 168394 [details] [review] multiload: Remove unused variable
Created attachment 168395 [details] [review] gweather: Remove unused variables
Created attachment 168396 [details] [review] battstat: Suggest parenthesis around assignment used as truth value
Created attachment 168397 [details] [review] accesx: variable should be GdkWindow, not GtkWindow
Created attachment 168398 [details] [review] cpufreq: Remove unused variable
Created attachment 168399 [details] [review] multiload: Render with Cairo
Created attachment 168400 [details] [review] accessx: Draw with Cairo
Created attachment 168401 [details] [review] battstat: Draw with Cairo
(In reply to comment #1) > Created an attachment (id=168390) [details] [review] > cpufreq: Link to dbus-glib Kjartan Maraas already fixed it in it master, see eb187f06a2ad4660e9e6d7f08a4332707eb4de75
Review of attachment 168398 [details] [review]: Pushed to git master, thanks!
Each applet has a different maintainer so getting people to review this could be quite some work...
I rebased this patch series to master; it (and more) now lives on the "gtk3" branch in git.
Created attachment 177581 [details] [review] Use gdk_window_get_width/height() instead of _get_geometry() Prototype has changed in GDK 3. Anyways, no need to use the full function when we only need width and height, it avoids a roundtrip to the server. Also store the GdkWindow instead of calling gtk_widget_get_window() several times.
Created attachment 177582 [details] [review] Use g_app_info_launch() instead of gdk_spawn_on_screen() gdk_spawn_on_screen() no longer exists in GDK 3. Using GAppInfo is cleaner: we can directly pass GFiles instead of URIs, and not mess with command line ourselves.
Created attachment 177583 [details] [review] Use GDK_WINDOW_XID() instead of GDK_WINDOW_XWINDOW() The latter no longer exists in GDK 3.
Created attachment 177584 [details] [review] Use gdk_x11_window_foreign_new_for_display() instead of gdk_window_foreign_new() gdk_window_foreign_new() has been removed in GDK 3. We have to use gdk_x11_window_foreign_new_for_display() and pass the display where we want the window. We know it's the default display because get_desktop_window() gets the root window for the default screen.
Created attachment 177585 [details] [review] Use GSource func instead of GtkFunction GtkFunction no longer exists in GTK+ 3.
Created attachment 177586 [details] [review] Use gdk_x11_display_get_xdisplay() instead of gdk_x11_drawable_get_xdisplay() The latter has been removed in GDK 3.
Created attachment 177587 [details] [review] Sync trashapplet/src/xstuff.c with gnome-panel Fixes building with GTK+ 3 (drawing with Cairo, remove GDK_WINDOW_XWINDOW...). Changes specific to gnome-applets: - use PanelAppletOrient instead of PanelOrientation - include libpanel-applet headers instead of private ones We also gain the animation in trash applet for free!
With the patches above I'm able to build all the applets from the always_build target (charpick, drivemount, geyes, mini-commander, gdkb-new, stickynotes, trashapplet - the null applet needs a one-liner I've not posted :-). I could not test the result, that's why I'd like a basic review before pushing to gtk3.
I'm going to commit these to get stuff going. We can always clean stuff up afterwards is something is broken. It's not like it isn't broken now after all :-)
Comment on attachment 168390 [details] [review] cpufreq: Link to dbus-glib This has been commited.
Comment on attachment 168391 [details] [review] drivemount: Fix "variable might be used uninitialized" This has been commited on the gtk3 branch.
Closing this now that these patches have landed in git.
It seems that the code in update_battery_image() in battstat_applet.c is broken; the state of the battery is not drawn on the battery image.
Ok, I found the cause, and reported the issue with a patch in bug 664301.