diff options
Diffstat (limited to 'src/libui_sdl/libui/unix/main.c')
| -rw-r--r-- | src/libui_sdl/libui/unix/main.c | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/src/libui_sdl/libui/unix/main.c b/src/libui_sdl/libui/unix/main.c index 409b659..66bd335 100644 --- a/src/libui_sdl/libui/unix/main.c +++ b/src/libui_sdl/libui/unix/main.c @@ -6,6 +6,33 @@ uiInitOptions options;  // kind of a hack  GThread* gtkthread; +GMutex glmutex; +int boub(GtkWidget* w); +void baba(GtkWidget* w); + +static void _eventfilter(GdkEvent* evt, gpointer data) +{ +    if (evt->type == GDK_EXPOSE) +    { +        GtkWidget* widget = gtk_get_event_widget(evt); +        if (isAreaWidget(widget)) +        { +            areaWidget* area = areaWidget(widget); +            areaPreRedraw(area); +            gtk_main_do_event(evt); +            areaPostRedraw(area); +            return; +        } +    } +     +    gtk_main_do_event(evt); +} + +static void _eventfilterdestroy(gpointer data) +{ +    printf("DELET\n"); +} +  const char *uiInit(uiInitOptions *o)  {  	GError *err = NULL; @@ -31,6 +58,10 @@ const char *uiInit(uiInitOptions *o)  	gtk_window_set_default_icon_list(iconlist); +	g_mutex_init(&glmutex); +	 +	gdk_event_handler_set(_eventfilter, NULL, _eventfilterdestroy); +	  	return NULL;  } |