Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect mask and fix warning #376

Merged

Conversation

ardrabczyk
Copy link
Contributor

@ardrabczyk ardrabczyk commented Dec 27, 2023

Fixes #375

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 a 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 Debian 12 its value is 89 so the method _incidentally_ works as 89
& 1 is 1 but on my Slackware system it's value is 88 and since 88 & 1
isn't 1 the method doesn't work.

Fixes phillipberndt#375
gcc and clang report warnings due to -Wwrite-strings:

    $ docker run -it --rm -v "$PWD":/workspace -w /workspace gcc sh -c 'apt-get update &&
    apt-get -y install libxcb1-dev libxcb-randr0-dev &&
    make'
    (...)
    cc -pipe -o2 -Wstrict-overflow=5 -fstack-protector-all -W -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wfloat-equal -Wformat-y2k -Winit-self -Winline -Winvalid-pch -Wmissing-declarations -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnormalized=nfc -Wold-style-definition -Woverlength-strings -Wpacked -Wpadded -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing=2 -Wstrict-prototypes -Wundef -Wunsafe-loop-optimizations -Wvolatile-register-var -Wwrite-strings  "-DAUTORANDR_PATH=\"\"" -o autorandr-launcher autorandr_launcher.c -lxcb -lxcb-randr
    autorandr_launcher.c: In function 'ar_launch':
    <command-line>: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    autorandr_launcher.c:47:41: note: in expansion of macro 'AUTORANDR_PATH'
       47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
          |                                         ^~~~~~~~~~~~~~
    autorandr_launcher.c:47:57: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
       47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
          |                                                         ^~~~~~~~~~
    autorandr_launcher.c:47:69: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
       47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
          |                                                                     ^~~~~~~~~~~
    autorandr_launcher.c:47:82: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
       47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
          |                                                                                  ^~~~~~~~~
@phillipberndt phillipberndt merged commit 303d00b into phillipberndt:master Dec 28, 2023
@phillipberndt
Copy link
Owner

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE events
2 participants