diff --git a/Makefile b/Makefile index 32cf664..5e1db52 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,7 @@ dist: $(PACKAGE)-$(VERSION)/src/about.c \ $(PACKAGE)-$(VERSION)/src/accel.c \ $(PACKAGE)-$(VERSION)/src/assistant.c \ + $(PACKAGE)-$(VERSION)/src/compat.c \ $(PACKAGE)-$(VERSION)/src/help.c \ $(PACKAGE)-$(VERSION)/src/menubar.c \ $(PACKAGE)-$(VERSION)/src/message.c \ diff --git a/include/Desktop/compat.h b/include/Desktop/compat.h index 6b61c9c..21ab104 100644 --- a/include/Desktop/compat.h +++ b/include/Desktop/compat.h @@ -87,4 +87,8 @@ # define GDK_KEY_uparrow GDK_uparrow # endif +# if GTK_CHECK_VERSION(3, 0, 0) +void gdk_window_clear(GdkWindow * window); +# endif + #endif /* !LIBDESKTOP_DESKTOP_COMPAT_H */ diff --git a/src/Makefile b/src/Makefile index 5a15840..6bb3031 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,7 +19,7 @@ INSTALL ?= install all: $(TARGETS) -libDesktop_OBJS = about.o accel.o assistant.o help.o menubar.o message.o mime.o toolbar.o +libDesktop_OBJS = about.o accel.o assistant.o compat.o help.o menubar.o message.o mime.o toolbar.o libDesktop_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) libDesktop_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) @@ -41,6 +41,9 @@ accel.o: accel.c assistant.o: assistant.c $(CC) $(libDesktop_CFLAGS) -c assistant.c +compat.o: compat.c + $(CC) $(libDesktop_CFLAGS) -c compat.c + help.o: help.c $(CC) $(libDesktop_CFLAGS) -c help.c diff --git a/src/compat.c b/src/compat.c new file mode 100644 index 0000000..c739893 --- /dev/null +++ b/src/compat.c @@ -0,0 +1,34 @@ +/* $Id$ */ +/* Copyright (c) 2012 Pierre Pronchery */ +/* This file is part of DeforaOS Desktop libDesktop */ +/* This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + + + +#include +#include "Desktop.h" + + +/* Compat */ +#if GTK_CHECK_VERSION(3, 0, 0) +/* gdk_window_clear */ +void gdk_window_clear(GdkWindow * window) +{ + Display * display; + Window wid; + + display = gdk_x11_get_default_xdisplay(); + wid = gdk_x11_window_get_xid(window); + XClearWindow(display, wid); +} +#endif diff --git a/src/project.conf b/src/project.conf index 2fe0e2d..c42ae96 100644 --- a/src/project.conf +++ b/src/project.conf @@ -7,5 +7,5 @@ dist=Makefile [libDesktop] type=library -sources=about.c,accel.c,assistant.c,help.c,menubar.c,message.c,mime.c,toolbar.c +sources=about.c,accel.c,assistant.c,compat.c,help.c,menubar.c,message.c,mime.c,toolbar.c install=$(PREFIX)/lib