diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index eebafd3a..c905d4a3 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,7 +34,7 @@ jobs: languages: ${{ matrix.language }} # Install dependencies - - run: sudo apt update && sudo apt install libdbus-1-dev libegl-dev libev-dev libgl-dev libpcre2-dev libpixman-1-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-damage0-dev libxcb-dpms0-dev libxcb-glx0-dev libxcb-image0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-util-dev libxcb-xfixes0-dev libxext-dev meson ninja-build uthash-dev + - run: sudo apt update && sudo apt install libdbus-1-dev libegl-dev libev-dev libgl-dev libpcre2-dev libpixman-1-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-damage0-dev libxcb-glx0-dev libxcb-image0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-util-dev libxcb-xfixes0-dev libxext-dev meson ninja-build uthash-dev if: ${{ matrix.language == 'cpp' }} # Autobuild diff --git a/CHANGELOG.md b/CHANGELOG.md index aeac2500..3261865a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,18 +41,19 @@ * Remove command line options `-n`, `-a`, and `-s`. They were removed more than 10 years ago, it's time to finally get rid of them entirely. (#1254) * Remove error message for `--glx-swap-method`, it was deprecated in v6. * Remove error message for passing argument to `--vsync` arguments, it was deprecated in v5. -* Option `--opengl` is now deprecated, use `--backend=glx` instead. +* Option `--opengl` is now deprecated, use `--backend=glx` instead. ## Bug fixes * Fix ghosting artifacts that sometimes occur when window manager is restarted (#1081) * Fix a bug where rounded corner is disabled after making a window fullscreen and back (#1216) -## Dependency changes +## Build changes * picom now uses some OpenGL 4.3 features. * picom now optionally depends on `rtkit` at runtime to give itself realtime scheduling priority. * `libconfig` is now a mandatory dependency, with a minimal supported version of 1.7. +* picom doesn't depend on `xcb-dpms` anymore. # v11.2 (2024-Feb-13) diff --git a/README.md b/README.md index f8de4998..f28218ac 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ Assuming you already have all the usual building tools installed (e.g. gcc, pyth * xcb * xcb-util * xcb-damage -* xcb-dpms * xcb-xfixes * xcb-shape * xcb-renderutil @@ -49,7 +48,7 @@ Assuming you already have all the usual building tools installed (e.g. gcc, pyth On Debian based distributions (e.g. Ubuntu), the needed packages are ``` -libconfig-dev libdbus-1-dev libegl-dev libev-dev libgl-dev libepoxy-dev libpcre2-dev libpixman-1-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-damage0-dev libxcb-dpms0-dev libxcb-glx0-dev libxcb-image0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-util-dev libxcb-xfixes0-dev libxext-dev meson ninja-build uthash-dev +libconfig-dev libdbus-1-dev libegl-dev libev-dev libgl-dev libepoxy-dev libpcre2-dev libpixman-1-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-damage0-dev libxcb-glx0-dev libxcb-image0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-util-dev libxcb-xfixes0-dev libxext-dev meson ninja-build uthash-dev ``` On Fedora, the needed packages are diff --git a/src/common.h b/src/common.h index 13f76608..df31e28f 100644 --- a/src/common.h +++ b/src/common.h @@ -217,8 +217,6 @@ typedef struct session { xcb_sync_fence_t sync_fence; /// Whether we are rendering the first frame after screen is redirected bool first_frame; - /// Whether screen has been turned off - bool screen_is_off; /// When last MSC event happened, in useconds. uint64_t last_msc_instant; /// The last MSC number @@ -332,8 +330,6 @@ typedef struct session { int composite_error; /// Major opcode for X Composite extension. int composite_opcode; - /// Whether X DPMS extension exists - bool dpms_exists; /// Whether X Shape extension exists. bool shape_exists; /// Event base number for X Shape extension. diff --git a/src/meson.build b/src/meson.build index 18982939..15b6c659 100644 --- a/src/meson.build +++ b/src/meson.build @@ -17,8 +17,8 @@ picom_inc = include_directories(['.', '../include']) cflags = [] required_xcb_packages = [ - 'xcb', 'xcb-composite', 'xcb-damage', 'xcb-dpms', 'xcb-glx', 'xcb-present', - 'xcb-randr', 'xcb-render', 'xcb-shape', 'xcb-sync', 'xcb-xfixes' + 'xcb', 'xcb-composite', 'xcb-damage', 'xcb-glx', 'xcb-present', 'xcb-randr', + 'xcb-render', 'xcb-shape', 'xcb-sync', 'xcb-xfixes' ] # Some XCB packages are here because their versioning differs (see check below). diff --git a/src/picom.c b/src/picom.c index b6cc235d..d2436be2 100644 --- a/src/picom.c +++ b/src/picom.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -2109,7 +2108,6 @@ static session_t *session_init(int argc, char **argv, Display *dpy, xcb_prefetch_extension_data(ps->c.c, &xcb_present_id); xcb_prefetch_extension_data(ps->c.c, &xcb_sync_id); xcb_prefetch_extension_data(ps->c.c, &xcb_glx_id); - xcb_prefetch_extension_data(ps->c.c, &xcb_dpms_id); ext_info = xcb_get_extension_data(ps->c.c, &xcb_render_id); if (!ext_info || !ext_info->present) { @@ -2179,12 +2177,6 @@ static session_t *session_init(int argc, char **argv, Display *dpy, ps->glx_event = ext_info->first_event; } - ext_info = xcb_get_extension_data(ps->c.c, &xcb_dpms_id); - ps->dpms_exists = ext_info && ext_info->present; - if (!ps->dpms_exists) { - log_warn("No DPMS extension"); - } - // Parse configuration file if (!parse_config(&ps->o, config_file)) { return NULL; diff --git a/src/x.c b/src/x.c index 897f4156..d0dc460d 100644 --- a/src/x.c +++ b/src/x.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -782,26 +781,6 @@ void x_request_vblank_event(struct x_connection *c, xcb_window_t window, uint64_ set_cant_fail_cookie(c, cookie); } -static inline bool dpms_screen_is_off(xcb_dpms_info_reply_t *info) { - // state is a bool indicating whether dpms is enabled - return info->state && (info->power_level != XCB_DPMS_DPMS_MODE_ON); -} - -bool x_check_dpms_status(struct x_connection *c, bool *screen_is_off) { - auto r = xcb_dpms_info_reply(c->c, xcb_dpms_info(c->c), NULL); - if (!r) { - log_error("Failed to query DPMS status."); - return false; - } - auto now_screen_is_off = dpms_screen_is_off(r); - if (*screen_is_off != now_screen_is_off) { - log_debug("Screen is now %s", now_screen_is_off ? "off" : "on"); - *screen_is_off = now_screen_is_off; - } - free(r); - return true; -} - /** * Convert a struct conv to a X picture convolution filter, normalizing the kernel * in the process. Allow the caller to specify the element at the center of the kernel, diff --git a/src/x.h b/src/x.h index 5e6a98d6..be23fae0 100644 --- a/src/x.h +++ b/src/x.h @@ -407,8 +407,3 @@ uint32_t attr_deprecated xcb_generate_id(xcb_connection_t *c); /// Ask X server to send us a notification for the next end of vblank. void x_request_vblank_event(struct x_connection *c, xcb_window_t window, uint64_t msc); - -/// Update screen_is_off to reflect the current DPMS state. -/// -/// Returns true if the DPMS state was successfully queried, false otherwise. -bool x_check_dpms_status(struct x_connection *c, bool *screen_is_off);