This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository e16-keyedit.
View the commit online.
commit cbfdd0872bf55650452f2e5961fd4730be66c81c
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Fri Dec 8 13:24:35 2023 +0100
Split window event handling functions
They deal with entirely different things.
---
ipc.c | 45 +++++++++++++++++++++++++++++++--------------
1 file changed, 31 insertions(+), 14 deletions(-)
diff --git a/ipc.c b/ipc.c
index d3219b5..2ea9267 100644
--- a/ipc.c
+++ b/ipc.c
@@ -39,8 +39,6 @@ static Window root_win = None;
static Window comms_win = None;
static Window my_msg_win = None;
static Client *e_client = NULL;
-static GdkWindow *gdkwin = NULL;
-static GdkWindow *gdkwin2 = NULL;
static void (*msg_receive_callback)(char *msg) = NULL;
static unsigned int Atom_ENL_MSG;
@@ -180,17 +178,34 @@ CommsGet(XEvent *ev)
}
static GdkFilterReturn
-CommsFilter(GdkXEvent *gdk_xevent, GdkEvent *event __UNUSED__,
- void *data __UNUSED__)
+FilterCommsWin(GdkXEvent *gdk_xevent, GdkEvent *event __UNUSED__,
+ void *data __UNUSED__)
{
- XEvent *xevent;
- char *msg;
+ XEvent *xevent = gdk_xevent;
- xevent = (XEvent *) gdk_xevent;
switch (xevent->type)
{
+ default:
+ break;
+
case DestroyNotify:
exit(1);
+ }
+
+ return GDK_FILTER_REMOVE;
+}
+
+static GdkFilterReturn
+FilterMyMsgWin(GdkXEvent *gdk_xevent, GdkEvent *event __UNUSED__,
+ void *data __UNUSED__)
+{
+ XEvent *xevent = gdk_xevent;
+ char *msg;
+
+ switch (xevent->type)
+ {
+ default:
+ break;
case ClientMessage:
if (xevent->xclient.message_type != Atom_ENL_MSG)
@@ -204,17 +219,17 @@ CommsFilter(GdkXEvent *gdk_xevent, GdkEvent *event __UNUSED__,
free(msg);
}
break;
-
- default:
- break;
}
+
return GDK_FILTER_REMOVE;
}
int
CommsInit(void (*msg_receive_func)(char *msg))
{
- if(CommsSetup())
+ GdkWindow *gdkwin;
+
+ if (CommsSetup())
return 1;
comms_win = CommsFindCommsWindow();
@@ -224,10 +239,12 @@ CommsInit(void (*msg_receive_func)(char *msg))
e_client = ClientCreate(comms_win);
gdkwin = gdk_window_foreign_new(comms_win);
- gdk_window_add_filter(gdkwin, CommsFilter, NULL);
- gdkwin2 = gdk_window_foreign_new(my_msg_win);
- gdk_window_add_filter(gdkwin2, CommsFilter, NULL);
gdk_window_set_events(gdkwin, GDK_STRUCTURE_MASK);
+ gdk_window_add_filter(gdkwin, FilterCommsWin, NULL);
+
+ gdkwin = gdk_window_foreign_new(my_msg_win);
+ gdk_window_add_filter(gdkwin, FilterMyMsgWin, NULL);
+
msg_receive_callback = msg_receive_func;
return 0;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.