Fixed high CPU usage after adding Wine fix

Author Mitja Felicijan <mitja.felicijan@gmail.com> 2026-04-16 23:44:13 +0200
Committer Mitja Felicijan <mitja.felicijan@gmail.com> 2026-04-16 23:44:13 +0200
Commit 6ae079dc9ad912b84850cd1a40fbb7bcf9c989f3 (patch)
-rw-r--r-- glitch.h 4
-rw-r--r-- logging.c 8
-rw-r--r-- manager.c 2
3 files changed, 7 insertions, 7 deletions
diff --git a/glitch.h b/glitch.h
...
26
#define COLOR_RESET    "\x1B[0m"
26
#define COLOR_RESET    "\x1B[0m"
27
  
27
  
28
typedef enum {
28
typedef enum {
  
29
	LOG_ERROR,
  
30
	LOG_WARNING,
29
	LOG_INFO,
31
	LOG_INFO,
30
	LOG_DEBUG,
32
	LOG_DEBUG,
31
	LOG_WARNING,
  
32
	LOG_ERROR,
  
33
} LogLevel;
33
} LogLevel;
34
  
34
  
35
typedef enum {
35
typedef enum {
...
diff --git a/logging.c b/logging.c
...
12
static LogLevel max_level = LOG_INFO;
12
static LogLevel max_level = LOG_INFO;
13
  
13
  
14
static const char* level_strings[] = {
14
static const char* level_strings[] = {
  
15
	"ERROR",
  
16
	"WARN",
15
	"INFO",
17
	"INFO",
16
	"DEBUG",
18
	"DEBUG",
17
	"WARN",
  
18
	"ERROR",
  
19
};
19
};
20
  
20
  
21
static const char* level_colors[] = {
21
static const char* level_colors[] = {
  
22
	COLOR_ERROR,
  
23
	COLOR_WARNING,
22
	COLOR_INFO,
24
	COLOR_INFO,
23
	COLOR_DEBUG,
25
	COLOR_DEBUG,
24
	COLOR_WARNING,
  
25
	COLOR_ERROR,
  
26
};
26
};
27
  
27
  
28
void set_log_level(LogLevel level) {
28
void set_log_level(LogLevel level) {
...
diff --git a/manager.c b/manager.c
...
714
void handle_configure_notify(void) {
714
void handle_configure_notify(void) {
715
	XConfigureEvent *ev = &wm.ev.xconfigure;
715
	XConfigureEvent *ev = &wm.ev.xconfigure;
716
  
716
  
717
	if (ev->window == wm.root) return;
717
	if (ev->window == wm.root || ev->send_event) return;
718
	
718
	
719
	// Only send synthetic events for windows we manage as top-level clients.
719
	// Only send synthetic events for windows we manage as top-level clients.
720
	Client *c;
720
	Client *c;
...