diff options
author | zhuyaliang <[email protected]> | 2023-10-24 19:56:51 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2023-11-06 12:56:20 +0100 |
commit | 688ec2f47167fcca1c3e14854b69640479422794 (patch) | |
tree | 4f4f2a806da2dca2bfc13aea2a74fa0a08fdb4a4 /applets | |
parent | 9a8cfd772538539776654401d7a1293595405c90 (diff) | |
download | mate-power-manager-688ec2f47167fcca1c3e14854b69640479422794.tar.bz2 mate-power-manager-688ec2f47167fcca1c3e14854b69640479422794.tar.xz |
Remove compilation warning fix data type format error
Diffstat (limited to 'applets')
-rw-r--r-- | applets/brightness/brightness-applet.c | 20 | ||||
-rw-r--r-- | applets/inhibit/inhibit-applet.c | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/applets/brightness/brightness-applet.c b/applets/brightness/brightness-applet.c index 125d45b..ff8f1ef 100644 --- a/applets/brightness/brightness-applet.c +++ b/applets/brightness/brightness-applet.c @@ -371,7 +371,7 @@ gpm_applet_update_tooltip (GpmBrightnessApplet *applet) } else if (applet->call_worked == FALSE) { buf = g_strdup (_("Cannot get laptop panel brightness")); } else { - buf = g_strdup_printf (_("LCD brightness : %d%%"), applet->level); + buf = g_strdup_printf (_("LCD brightness : %u%%"), applet->level); } gtk_widget_set_tooltip_text (GTK_WIDGET(applet), buf); } else { @@ -607,6 +607,10 @@ static void gpm_applet_create_popup (GpmBrightnessApplet *applet) { static GtkWidget *box, *frame; + GtkWidget *toplevel; + GtkStyleContext *context; + GdkScreen *screen; + GdkVisual *visual; gint orientation = mate_panel_applet_get_orient (MATE_PANEL_APPLET (MATE_PANEL_APPLET (applet))); gpm_applet_destroy_popup_cb (applet); @@ -664,13 +668,12 @@ gpm_applet_create_popup (GpmBrightnessApplet *applet) G_CALLBACK(gpm_applet_key_press_cb), applet); /* Set volume control frame, slider and toplevel window to follow panel volume control theme */ - GtkWidget *toplevel = gtk_widget_get_toplevel (frame); - GtkStyleContext *context; + toplevel = gtk_widget_get_toplevel (frame); context = gtk_widget_get_style_context (GTK_WIDGET(toplevel)); gtk_style_context_add_class(context,"mate-panel-applet-slider"); /*Make transparency possible in gtk3 theme3 */ - GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(toplevel)); - GdkVisual *visual = gdk_screen_get_rgba_visual(screen); + screen = gtk_widget_get_screen(GTK_WIDGET(toplevel)); + visual = gdk_screen_get_rgba_visual(screen); gtk_widget_set_visual(GTK_WIDGET(toplevel), visual); } @@ -702,11 +705,6 @@ gpm_applet_popup_cb (GpmBrightnessApplet *applet, GdkEventButton *event) return TRUE; } - /* don't show the popup if brightness is unavailable */ - if (applet->level == -1) { - return FALSE; - } - /* otherwise pop */ applet->popped = TRUE; @@ -899,7 +897,7 @@ brightness_changed_cb (DBusGProxy *proxy, guint brightness, GpmBrightnessApplet *applet) { - g_debug ("BrightnessChanged detected: %i\n", brightness); + g_debug ("BrightnessChanged detected: %u\n", brightness); applet->level = brightness; } diff --git a/applets/inhibit/inhibit-applet.c b/applets/inhibit/inhibit-applet.c index ab64597..02f1862 100644 --- a/applets/inhibit/inhibit-applet.c +++ b/applets/inhibit/inhibit-applet.c @@ -202,6 +202,8 @@ gpm_applet_size_allocate_cb (GtkWidget *widget, case MATE_PANEL_APPLET_ORIENT_DOWN: size = allocation->height; break; + default: + break; } /* Scale to the actual size of the applet, don't quantize to original icon size */ |