static void X11_destroy_window(void);
static void X11_create_window(void);
+static void X11_initialisation(void);
struct _x11_stuff_s {
Region region;
return;
} else
#endif
- {
+ if (display && window.window) { // make sure these are !null
/* there is some extra space for borders and outlines */
XClearArea(display, window.window, text_start_x - border_margin - 1,
text_start_y - border_margin - 1,
XFixesDestroyRegion(display, x11_stuff.region2);
XFixesDestroyRegion(display, x11_stuff.part);
#endif /* HAVE_XDAMAGE */
- if (disp)
+ if (disp) {
free(disp);
+ }
}
#endif /* X11 */
if(overwrite_file) {
}
#endif /* HAVE_SYS_INOTIFY_H */
-#if defined(X11) && defined(HAVE_XDAMAGE)
+#ifdef X11
X11_destroy_window();
-#endif /* X11 && HAVE_XDAMAGE */
+#endif /* X11 */
}
static void load_config_file(const char *);
static void load_config_file_x11(const char *);
-/* reload the config file */
+ /* reload the config file */
static void reload_config(void)
{
timed_thread_destroy_registered_threads();
#ifdef X11
x_initialised = NO;
+ if (output_methods & TO_X) {
+ X11_initialisation();
+ }
#endif /* X11 */
extract_variable_text(global_text);
free(global_text);
XDamageDestroy(display, x11_stuff.damage);
XFixesDestroyRegion(display, x11_stuff.region2);
XFixesDestroyRegion(display, x11_stuff.part);
- if (x11_stuff.region)
+ if (x11_stuff.region) {
XDestroyRegion(x11_stuff.region);
+ }
x11_stuff.region = NULL;
#endif /* HAVE_XDAMAGE */
destroy_window();
}
CONF("text") {
#ifdef X11
- if(output_methods & TO_X) {
+ if (output_methods & TO_X) {
X11_initialisation();
}
#endif
/* load font */
if (output_methods & TO_X) {
load_config_file_x11(current_config);
- load_fonts();
}
#endif /* X11 */