Merge branch 'cairo' of ssh://thinky/home/knopwob/src/c/dunst into cairo

This commit is contained in:
Sascha Kruse 2013-02-25 20:43:00 +00:00
commit 44612489ab
4 changed files with 15 additions and 5 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ vgcore.*
config.h config.h
dunst.1 dunst.1
org.knopwob.dunst.service org.knopwob.dunst.service
dunstify

View File

@ -14,7 +14,7 @@ SRC = x.c \
notification.c notification.c
OBJ = ${SRC:.c=.o} OBJ = ${SRC:.c=.o}
all: doc options dunst service all: doc options dunst service dunstify
options: options:
@echo dunst build options: @echo dunst build options:
@ -50,6 +50,7 @@ clean:
@rm -f dunst.1 @rm -f dunst.1
@rm -f org.knopwob.dunst.service @rm -f org.knopwob.dunst.service
@rm -f core @rm -f core
@rm -f dunstify
doc: dunst.1 doc: dunst.1
dunst.1: README.pod dunst.1: README.pod

View File

@ -285,6 +285,7 @@ int main(int argc, char *argv[])
l = g_main_loop_new(NULL, false); l = g_main_loop_new(NULL, false);
g_signal_connect(n, "closed", G_CALLBACK(closed), NULL); g_signal_connect(n, "closed", G_CALLBACK(closed), NULL);
if (action_strs)
for (int i = 0; action_strs[i]; i++) { for (int i = 0; action_strs[i]; i++) {
add_action(n, action_strs[i]); add_action(n, action_strs[i]);
} }

9
x.c
View File

@ -506,6 +506,10 @@ gboolean x_mainloop_fd_dispatch(GSource * source, GSourceFunc callback,
context_menu(); context_menu();
} }
break; break;
case FocusIn:
case FocusOut:
printf("Focus Event\n");
wake_up();
} }
} }
return true; return true;
@ -751,7 +755,7 @@ void x_win_setup(void)
wa.background_pixmap = ParentRelative; wa.background_pixmap = ParentRelative;
wa.event_mask = wa.event_mask =
ExposureMask | KeyPressMask | VisibilityChangeMask | ExposureMask | KeyPressMask | VisibilityChangeMask |
ButtonPressMask; ButtonPressMask | FocusChangeMask;
screen_info scr; screen_info scr;
x_screen_info(&scr); x_screen_info(&scr);
@ -767,6 +771,9 @@ void x_win_setup(void)
setopacity(xctx.win, setopacity(xctx.win,
(unsigned long)((100 - settings.transparency) * (unsigned long)((100 - settings.transparency) *
(0xffffffff / 100))); (0xffffffff / 100)));
long root_event_mask = FocusChangeMask;
XSelectInput(xctx.dpy, root, root_event_mask);
} }
/* /*