diff --git a/bin/dwn b/bin/dwn index ebd8535..7f3c6b1 100755 Binary files a/bin/dwn and b/bin/dwn differ diff --git a/build/ai.o b/build/ai.o index 134230b..b3a7f04 100644 Binary files a/build/ai.o and b/build/ai.o differ diff --git a/build/autostart.o b/build/autostart.o index a6d6a22..46880e1 100644 Binary files a/build/autostart.o and b/build/autostart.o differ diff --git a/build/client.o b/build/client.o index da60ae1..c7f0a79 100644 Binary files a/build/client.o and b/build/client.o differ diff --git a/build/config.o b/build/config.o index 9ff40ca..83397e7 100644 Binary files a/build/config.o and b/build/config.o differ diff --git a/build/demo.o b/build/demo.o index c6d4db1..81e0dce 100644 Binary files a/build/demo.o and b/build/demo.o differ diff --git a/build/layout.o b/build/layout.o index 3e600f9..7165d75 100644 Binary files a/build/layout.o and b/build/layout.o differ diff --git a/build/main.o b/build/main.o index 3f05ec5..62466d3 100644 Binary files a/build/main.o and b/build/main.o differ diff --git a/build/notifications.o b/build/notifications.o index 59a15ce..4e64915 100644 Binary files a/build/notifications.o and b/build/notifications.o differ diff --git a/build/panel.o b/build/panel.o index 397e2df..27edac7 100644 Binary files a/build/panel.o and b/build/panel.o differ diff --git a/build/systray.o b/build/systray.o index 24c3fa7..9e1e645 100644 Binary files a/build/systray.o and b/build/systray.o differ diff --git a/build/workspace.o b/build/workspace.o index f30e2c6..ca33404 100644 Binary files a/build/workspace.o and b/build/workspace.o differ diff --git a/include/config.h b/include/config.h index 4943f12..17a6f91 100644 --- a/include/config.h +++ b/include/config.h @@ -39,7 +39,6 @@ struct Config { int panel_height; int gap; char font_name[128]; - double mouse_distance_dpi; ColorScheme colors; float default_master_ratio; diff --git a/include/dwn.h b/include/dwn.h index a59f9d2..3a32cc7 100644 --- a/include/dwn.h +++ b/include/dwn.h @@ -215,9 +215,6 @@ typedef struct { int last_mouse_x; int last_mouse_y; bool mouse_tracking_initialized; - - double pixels_per_cm; - bool dpi_auto_detected; } DWNState; #define PHASE_OFFSET_PANEL_BG 0.0f diff --git a/src/config.c b/src/config.c index 8f0b317..a2376e0 100644 --- a/src/config.c +++ b/src/config.c @@ -61,7 +61,6 @@ void config_set_defaults(Config *cfg) cfg->panel_height = DEFAULT_PANEL_HEIGHT; cfg->gap = DEFAULT_GAP; strncpy(cfg->font_name, "fixed", sizeof(cfg->font_name) - 1); - cfg->mouse_distance_dpi = 0.0; cfg->default_master_ratio = 0.55f; cfg->default_master_count = 1; @@ -159,9 +158,6 @@ static void handle_config_entry(const char *section, const char *key, cfg->gap = (val >= 0 && val <= 100) ? val : DEFAULT_GAP; } else if (strcmp(key, "font") == 0) { strncpy(cfg->font_name, value, sizeof(cfg->font_name) - 1); - } else if (strcmp(key, "mouse_distance_dpi") == 0) { - double val = atof(value); - cfg->mouse_distance_dpi = (val > 0.0) ? val : 0.0; } } else if (strcmp(section, "layout") == 0) { if (strcmp(key, "master_ratio") == 0) { diff --git a/src/main.c b/src/main.c index 00e64a5..f7fac66 100644 --- a/src/main.c +++ b/src/main.c @@ -218,42 +218,6 @@ static void handle_xi2_event(XGenericEventCookie *cookie) XFreeEventData(dwn->display, cookie); } -static double calculate_pixels_per_cm(void) -{ - if (dwn->config->mouse_distance_dpi > 0.0) { - LOG_DEBUG("Using manual DPI override: %.1f", dwn->config->mouse_distance_dpi); - return dwn->config->mouse_distance_dpi / 2.54; - } - - int width_mm = DisplayWidthMM(dwn->display, dwn->screen); - int height_mm = DisplayHeightMM(dwn->display, dwn->screen); - - if (width_mm > 0 && height_mm > 0) { - double diag_pixels = sqrt((double)dwn->screen_width * dwn->screen_width + - (double)dwn->screen_height * dwn->screen_height); - double diag_mm = sqrt((double)width_mm * width_mm + (double)height_mm * height_mm); - double diag_cm = diag_mm / 10.0; - - double pixels_per_cm = diag_pixels / diag_cm; - - if (pixels_per_cm >= 20.0 && pixels_per_cm <= 200.0) { - dwn->dpi_auto_detected = true; - double dpi = pixels_per_cm * 2.54; - LOG_INFO("Auto-detected DPI: %.1f (%.2f pixels/cm) from EDID: %dx%dmm for %dx%dpx", - dpi, pixels_per_cm, width_mm, height_mm, - dwn->screen_width, dwn->screen_height); - return pixels_per_cm; - } else { - LOG_WARN("EDID data appears corrupt: %.1f pixels/cm detected, ignoring", - pixels_per_cm); - } - } - - LOG_WARN("Could not detect screen DPI from EDID, using default 96 DPI"); - dwn->dpi_auto_detected = false; - return 37.8; -} - static void init_monitors(void) { if (!XineramaIsActive(dwn->display)) { @@ -878,8 +842,6 @@ int dwn_init(void) extern void config_init_colors(Config *cfg); config_init_colors(dwn->config); - dwn->pixels_per_cm = calculate_pixels_per_cm(); - dwn->font = XLoadQueryFont(dwn->display, dwn->config->font_name); if (dwn->font == NULL) { dwn->font = XLoadQueryFont(dwn->display, "fixed"); diff --git a/src/panel.c b/src/panel.c index 2d24213..fdbd88d 100644 --- a/src/panel.c +++ b/src/panel.c @@ -1348,7 +1348,7 @@ static void panel_render_mouse_distance(Panel *panel, int x, int *width) int text_y = panel_text_y(panel->height); char buf[32]; - double cm = dwn->mouse_distance_pixels / dwn->pixels_per_cm; + double cm = dwn->mouse_distance_pixels / 37.8; int len; if (cm >= 100000.0) {