[go: up one dir, main page]

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

Check result of reading _NET_WORKAREA before using #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gridbugs
Copy link

It seems like not all window managers set _NET_WORKAREA. For example in
dwm this property isn't set when X first starts (but running certain
graphical applications such as firefox seem to cause the property to
become set). This change prevents a crash when bsnes is run in an
environment where _NET_WORKAREA has not been set.

Prior to this change, running bsnes as the first program under the dwm
window manager would result in the following error:

The program 'hiro' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAtom (invalid Atom parameter)'.

This was the result of calling XGetWindowProperty with an Atom which
does not name a defined Atom.

Reproducing/Testing

I can reliably reproduce the problem on an Archlinux machine and on a NixOS machine, both using dwm as their window manager. In a fresh X session, running bsnes consistently results in the aforementioned crash. After launching a graphical application such as firefox, bsnes starts without error.

I've tried reproducing the problem on a ubuntu machine with xfce4 as its wm. Launching bsnes in a fresh X session works. I assume this is because xfce4 implements _NET_WORKAREA.

It seems like not all window managers set _NET_WORKAREA. For example in
dwm this property isn't set when X first starts (but running certain
graphical applications such as firefox seem to cause the property to
become set). This change prevents a crash when bsnes is run in an
environment where _NET_WORKAREA has not been set.

Prior to this change, running bsnes as the first program under the dwm
window manager would result in the following error:

The program 'hiro' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAtom (invalid Atom parameter)'.

This was the result of calling XGetWindowProperty with an Atom which
does not name a defined Atom.
@DerKoun
Copy link
Owner
DerKoun commented Aug 2, 2021

I'll likely merge this with the next release

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.

2 participants