Browse Source

Add a wallpaper_changed signal

This signal fires whenever the, well, wallpaper changes. Who would have guessed?

Signed-off-by: Uli Schlachter <psychon@znc.in>
Uli Schlachter 7 years ago
parent
commit
2bd29f2ab4
3 changed files with 14 additions and 0 deletions
  1. 1
    0
      globalconf.h
  2. 1
    0
      luaa.c
  3. 12
    0
      property.c

+ 1
- 0
globalconf.h View File

@@ -44,6 +44,7 @@
44 44
       | XCB_EVENT_MASK_BUTTON_PRESS \
45 45
       | XCB_EVENT_MASK_BUTTON_RELEASE \
46 46
       | XCB_EVENT_MASK_FOCUS_CHANGE \
47
+      | XCB_EVENT_MASK_PROPERTY_CHANGE \
47 48
     }
48 49
 
49 50
 typedef struct drawin_t drawin_t;

+ 1
- 0
luaa.c View File

@@ -658,6 +658,7 @@ luaA_init(xdgHandle* xdg)
658 658
     signal_add(&global_signals, "debug::index::miss");
659 659
     signal_add(&global_signals, "debug::newindex::miss");
660 660
     signal_add(&global_signals, "systray::update");
661
+    signal_add(&global_signals, "wallpaper_changed");
661 662
     signal_add(&global_signals, "refresh");
662 663
     signal_add(&global_signals, "exit");
663 664
 }

+ 12
- 0
property.c View File

@@ -359,6 +359,15 @@ property_handle_net_wm_opacity(uint8_t state,
359 359
     return 0;
360 360
 }
361 361
 
362
+static int
363
+property_handle_xrootpmap_id(uint8_t state,
364
+                             xcb_window_t window)
365
+{
366
+    signal_object_emit(globalconf.L, &global_signals, "wallpaper_changed", 0);
367
+    return 0;
368
+}
369
+
370
+
362 371
 /** The property notify event handler.
363 372
  * \param data Unused data.
364 373
  * \param connection The connection to the X server.
@@ -404,6 +413,9 @@ property_handle_propertynotify(xcb_property_notify_event_t *ev)
404 413
     HANDLE(_NET_WM_PID, property_handle_net_wm_pid)
405 414
     HANDLE(_NET_WM_WINDOW_OPACITY, property_handle_net_wm_opacity)
406 415
 
416
+    /* background change */
417
+    HANDLE(_XROOTPMAP_ID, property_handle_xrootpmap_id)
418
+
407 419
     /* If nothing was found, return */
408 420
     END;
409 421
 

Loading…
Cancel
Save