Skip to content

Commit

Permalink
clipmenud: Print selection names in debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cdown committed Apr 10, 2024
1 parent 09da953 commit 8353b2a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/clipmenud.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,10 @@ static void handle_xfixes_selection_notify(XFixesSelectionNotifyEvent *se) {
return;
}

dbg("Notified about selection update. Selection: %lu, Owner: '%s' (0x%lx)\n",
(unsigned long)se->selection, strnull(win_title),
(unsigned long)se->owner);
enum selection_type sel =
selection_atom_to_selection_type(se->selection, sels);
dbg("Notified about selection update. Selection: %s, Owner: '%s' (0x%lx)\n",
cfg.selections[sel].name, strnull(win_title), (unsigned long)se->owner);
XConvertSelection(dpy, se->selection,
XInternAtom(dpy, "UTF8_STRING", False), sels[sel].storage,
win, CurrentTime);
Expand All @@ -175,8 +174,10 @@ static void handle_xfixes_selection_notify(XFixesSelectionNotifyEvent *se) {
*/
static int handle_selection_notify(const XSelectionEvent *se) {
if (se->property == None) {
dbg("X reports that %lu has no current owner\n",
(unsigned long)se->selection);
enum selection_type sel =
selection_atom_to_selection_type(se->selection, sels);
dbg("X reports that %s has no current owner\n",
cfg.selections[sel].name);
return -ENOENT;
}
return 0;
Expand Down

0 comments on commit 8353b2a

Please sign in to comment.