Browse Source

Wallpaper should accept USR2 to restore window stack order like panel does

K. Lange 2 years ago
parent
commit
14e27abfe1
1 changed files with 8 additions and 0 deletions
  1. 8 0
      apps/background.c

+ 8 - 0
apps/background.c

@@ -12,6 +12,7 @@
  */
 #include <stdio.h>
 #include <unistd.h>
+#include <signal.h>
 #include <sys/utsname.h>
 #include <sys/wait.h>
 #include <sys/fswait.h>
@@ -85,6 +86,11 @@ static void check_click(struct yutani_msg_window_mouse_event * evt) {
 	}
 }
 
+static void sig_usr2(int sig) {
+	yutani_set_stack(yctx, wallpaper_window, YUTANI_ZORDER_BOTTOM);
+	yutani_flip(yctx, wallpaper_window);
+}
+
 int main (int argc, char ** argv) {
 
 	if (argc < 2 || strcmp(argv[1],"--really")) {
@@ -97,6 +103,8 @@ int main (int argc, char ** argv) {
 		return 1;
 	}
 
+	signal(SIGUSR2, sig_usr2);
+
 	wallpaper = malloc(sizeof(sprite_t));
 	load_sprite(wallpaper, "/usr/share/wallpaper.bmp");
 	wallpaper->alpha = 0;