Comments (2)
It works ok on debian-live-12.4.0 so there must be issue with my system.
from autorandr.
if (evt->response_type &
XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE) {
I think this code is not correct. Value of evt->response_type
comes from X11 server and at least in Xorg it's not constant but depends on number of loaded extensions https://gitlab.freedesktop.org/xorg/xserver/-/blob/21b3dad2380639573c251d95910bcb644049ee5f/mi/miinitext.c#L110 and number of arguments each loaded extension takes. When randr module is loaded https://gitlab.freedesktop.org/xorg/xserver/-/blob/d6c02ffd9c910637f6b3b7249507998e9e45f93c/randr/randr.c#L439 REventBase
is calculated. On my Slackware system its value is 88 but on Debian 12 is 89. It's different because Debian loads more extensions:
user@debian:~$ grep 'Initializing extension ' /var/log/Xorg.0.log | tee /dev/tty | wc -l
[ 16.803] (II) Initializing extension Generic Event Extension
[ 16.803] (II) Initializing extension SHAPE
[ 16.803] (II) Initializing extension MIT-SHM
[ 16.803] (II) Initializing extension XInputExtension
[ 16.804] (II) Initializing extension XTEST
[ 16.804] (II) Initializing extension BIG-REQUESTS
[ 16.804] (II) Initializing extension SYNC
[ 16.804] (II) Initializing extension XKEYBOARD
[ 16.805] (II) Initializing extension XC-MISC
[ 16.805] (II) Initializing extension SECURITY
[ 16.805] (II) Initializing extension XFIXES
[ 16.805] (II) Initializing extension RENDER
[ 16.805] (II) Initializing extension RANDR
[ 16.806] (II) Initializing extension COMPOSITE
[ 16.806] (II) Initializing extension DAMAGE
[ 16.806] (II) Initializing extension MIT-SCREEN-SAVER
[ 16.807] (II) Initializing extension DOUBLE-BUFFER
[ 16.807] (II) Initializing extension RECORD
[ 16.807] (II) Initializing extension DPMS
[ 16.807] (II) Initializing extension Present
[ 16.808] (II) Initializing extension DRI3
[ 16.808] (II) Initializing extension X-Resource
[ 16.808] (II) Initializing extension XVideo
[ 16.808] (II) Initializing extension XVideo-MotionCompensation
[ 16.808] (II) Initializing extension SELinux
[ 16.809] (II) Initializing extension GLX
[ 16.828] (II) Initializing extension XFree86-VidModeExtension
[ 16.829] (II) Initializing extension XFree86-DGA
[ 16.829] (II) Initializing extension XFree86-DRI
[ 16.829] (II) Initializing extension DRI2
30
while on Slackware:
$ grep 'Initializing extension ' /var/log/Xorg.0.log | tee /dev/tty | wc -l
[3306952.346] (II) Initializing extension Generic Event Extension
[3306952.346] (II) Initializing extension SHAPE
[3306952.346] (II) Initializing extension MIT-SHM
[3306952.346] (II) Initializing extension XInputExtension
[3306952.346] (II) Initializing extension XTEST
[3306952.346] (II) Initializing extension BIG-REQUESTS
[3306952.346] (II) Initializing extension SYNC
[3306952.346] (II) Initializing extension XKEYBOARD
[3306952.346] (II) Initializing extension XC-MISC
[3306952.346] (II) Initializing extension XFIXES
[3306952.346] (II) Initializing extension RENDER
[3306952.346] (II) Initializing extension RANDR
[3306952.346] (II) Initializing extension COMPOSITE
[3306952.346] (II) Initializing extension DAMAGE
[3306952.346] (II) Initializing extension MIT-SCREEN-SAVER
[3306952.346] (II) Initializing extension DOUBLE-BUFFER
[3306952.346] (II) Initializing extension RECORD
[3306952.346] (II) Initializing extension DPMS
[3306952.346] (II) Initializing extension Present
[3306952.346] (II) Initializing extension DRI3
[3306952.346] (II) Initializing extension X-Resource
[3306952.346] (II) Initializing extension XVideo
[3306952.346] (II) Initializing extension XVideo-MotionCompensation
[3306952.346] (II) Initializing extension GLX
[3306952.352] (II) Initializing extension XFree86-VidModeExtension
[3306952.352] (II) Initializing extension XFree86-DGA
[3306952.352] (II) Initializing extension XFree86-DRI
[3306952.352] (II) Initializing extension DRI2
28
SELinux extension loaded on Debian doesn't take any events but SECURITY takes one. If Xorg on Slackware is recompiled with --enable-xcsecurity REventBase
is set to 89 too.
So the conclusion is that autorandr_launcher.c works coincidentally on systems where generated REventBase
satisfies & XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE
condition. Instead of checking the mask a value of event should be checked, check out how xev is doing it for example or maybe since only XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE is specifically requested nothing needs to be done.
from autorandr.
Related Issues (20)
- make appimage format or binary file
- ~/.config/autorandr/postswitch doesn't execute when profile has postswitch HOT 1
- /home/thinker/./autorandr:49: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.version import LooseVersion as Version HOT 1
- Question: should autorandr systemd service change profile when external monitor is unplugged? HOT 2
- Use of --skip-options breaks --current HOT 1
- Parsing XRandR output failed HOT 1
- Detected Wayland session 'wayland-0'. Exiting.
- Failed to apply profile because xrandr cannot find mode
- postscript loses authentication for systemctl commands after suspending HOT 1
- Unhandled exception (local variable 'output' referenced before assignment) HOT 1
- Broken regexes due to missing `r` string literal HOT 6
- Unable to save lid state when using NVIDIA GPU (no eDP / LVDS output)
- Total system crash + soundloop could be caused by autorandr
- Total system crash + soundloop could be caused by autorandr
- Prevent profile change with screen lock HOT 1
- Additional Documentation HOT 7
- autorandr.service "Failed to load profile: 'xxx' : Profile not found" althoug profile exists HOT 1
- Failed to apply profile due to `--crtc` option HOT 2
- Incorrect profile settings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autorandr.