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

Minimizing and changing the keyboard layout triggers an unhandled event #879

Closed
kimci86 opened this Issue May 8, 2015 · 15 comments

Comments

Projects
None yet
7 participants
@kimci86
Contributor

kimci86 commented May 8, 2015

I'm using Ubuntu 14.04 and SFML 2.3 (commit 80214d1)
When I minimize a window, I get this message:

X Extensions:
    Generic Event Extension - First event: 0
    SHAPE - First event: 64
    MIT-SHM - First event: 65
    XInputExtension - First event: 66
    XTEST - First event: 0
    BIG-REQUESTS - First event: 0
    SYNC - First event: 83
    XKEYBOARD - First event: 85
    XC-MISC - First event: 0
    SECURITY - First event: 86
    XFIXES - First event: 87
    RENDER - First event: 0
    RANDR - First event: 89
    XINERAMA - First event: 0
    Composite - First event: 0
    DAMAGE - First event: 91
    MIT-SCREEN-SAVER - First event: 92
    DOUBLE-BUFFER - First event: 0
    RECORD - First event: 0
    DPMS - First event: 0
    Present - First event: 0
    DRI3 - First event: 0
    X-Resource - First event: 0
    XVideo - First event: 93
    XFree86-VidModeExtension - First event: 0
    XFree86-DGA - First event: 95
    DRI2 - First event: 102
    GLX - First event: 104
    SGI-GLX - First event: 104
Unhandled event type: 64
Report this to the SFML maintainers if possible

Minimal example code to reproduce it:

#include <SFML/Window.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "My window");
    while(window.isOpen())
    {
        sf::Event event;
        while(window.pollEvent(event))
            if(event.type == sf::Event::Closed)
                window.close();
        sf::sleep(sf::milliseconds(20));
    }
    return 0;
}
@binary1248

This comment has been minimized.

Show comment
Hide comment
@binary1248

binary1248 May 8, 2015

Member

Are you using a compositor or have any window manager effects enabled?

Member

binary1248 commented May 8, 2015

Are you using a compositor or have any window manager effects enabled?

@kimci86

This comment has been minimized.

Show comment
Hide comment
@kimci86

kimci86 May 9, 2015

Contributor

I am using the default Ubuntu setup. Disabling animations in CompizConfig Settings Manager did not change anything.

Contributor

kimci86 commented May 9, 2015

I am using the default Ubuntu setup. Disabling animations in CompizConfig Settings Manager did not change anything.

@zmertens

This comment has been minimized.

Show comment
Hide comment
@zmertens

zmertens May 9, 2015

Also on Ubuntu 14.04 using 80214d1 version of SFML and I get the same error. I noticed it only shows up once even if I bring the window back up and repeatedly minimize it again. Here's my log:

X Extensions:
        XINERAMA - First event: 0
        Generic Event Extension - First event: 0
        SHAPE - First event: 64
        MIT-SHM - First event: 65
        XInputExtension - First event: 66
        XTEST - First event: 0
        BIG-REQUESTS - First event: 0
        SYNC - First event: 83
        XKEYBOARD - First event: 85
        XC-MISC - First event: 0
        SECURITY - First event: 86
        XFIXES - First event: 87
        RENDER - First event: 0
        RANDR - First event: 89
        XINERAMA - First event: 0
        Composite - First event: 0
        DAMAGE - First event: 91
        MIT-SCREEN-SAVER - First event: 92
        DOUBLE-BUFFER - First event: 0
        RECORD - First event: 0
        DPMS - First event: 0
        Present - First event: 0
        DRI3 - First event: 0
        X-Resource - First event: 0
        XVideo - First event: 93
        XVideo-MotionCompensation - First event: 0
        XFree86-VidModeExtension - First event: 0
        XFree86-DGA - First event: 95
        DRI2 - First event: 102
        GLX - First event: 104
        SGI-GLX - First event: 104
        ATIFGLRXDRI - First event: 0
        ATIFGLEXTENSION - First event: 0
        glesx - First event: 0
        AMDXVOPL - First event: 0
        AMDXVBA - First event: 0
Unhandled event type: 64
Report this to the SFML maintainers if possible

zmertens commented May 9, 2015

Also on Ubuntu 14.04 using 80214d1 version of SFML and I get the same error. I noticed it only shows up once even if I bring the window back up and repeatedly minimize it again. Here's my log:

X Extensions:
        XINERAMA - First event: 0
        Generic Event Extension - First event: 0
        SHAPE - First event: 64
        MIT-SHM - First event: 65
        XInputExtension - First event: 66
        XTEST - First event: 0
        BIG-REQUESTS - First event: 0
        SYNC - First event: 83
        XKEYBOARD - First event: 85
        XC-MISC - First event: 0
        SECURITY - First event: 86
        XFIXES - First event: 87
        RENDER - First event: 0
        RANDR - First event: 89
        XINERAMA - First event: 0
        Composite - First event: 0
        DAMAGE - First event: 91
        MIT-SCREEN-SAVER - First event: 92
        DOUBLE-BUFFER - First event: 0
        RECORD - First event: 0
        DPMS - First event: 0
        Present - First event: 0
        DRI3 - First event: 0
        X-Resource - First event: 0
        XVideo - First event: 93
        XVideo-MotionCompensation - First event: 0
        XFree86-VidModeExtension - First event: 0
        XFree86-DGA - First event: 95
        DRI2 - First event: 102
        GLX - First event: 104
        SGI-GLX - First event: 104
        ATIFGLRXDRI - First event: 0
        ATIFGLEXTENSION - First event: 0
        glesx - First event: 0
        AMDXVOPL - First event: 0
        AMDXVBA - First event: 0
Unhandled event type: 64
Report this to the SFML maintainers if possible
@binary1248

This comment has been minimized.

Show comment
Hide comment
@binary1248

binary1248 May 10, 2015

Member

I noticed it only shows up once even if I bring the window back up and repeatedly minimize it again.

This is by design so that the same warning doesn't spam your output.

I can reproduce the issue in Ubuntu 14.04 and 14.10. It seems to be coming from compiz since it doesn't happen in any desktop environment besides Unity. Since many Ubuntu users will probably be using Unity which relies on compiz, I guess this warrants a whitelist.

Member

binary1248 commented May 10, 2015

I noticed it only shows up once even if I bring the window back up and repeatedly minimize it again.

This is by design so that the same warning doesn't spam your output.

I can reproduce the issue in Ubuntu 14.04 and 14.10. It seems to be coming from compiz since it doesn't happen in any desktop environment besides Unity. Since many Ubuntu users will probably be using Unity which relies on compiz, I guess this warrants a whitelist.

@binary1248 binary1248 added s:accepted and removed s:undecided labels May 10, 2015

@binary1248 binary1248 self-assigned this May 10, 2015

binary1248 added a commit that referenced this issue May 10, 2015

Whitelisted SHAPE events that might be sent by some compositing windo…
…w managers even if we didn't select them. Fixes #879
@binary1248

This comment has been minimized.

Show comment
Hide comment
Member

binary1248 commented May 10, 2015

@kimci86

This comment has been minimized.

Show comment
Hide comment
@kimci86

kimci86 May 10, 2015

Contributor

This fixes the problem. No message is showing up now. 👍

Contributor

kimci86 commented May 10, 2015

This fixes the problem. No message is showing up now. 👍

@zmertens

This comment has been minimized.

Show comment
Hide comment
@zmertens

zmertens May 10, 2015

Also tested shape_event branch and the error message is gone.

zmertens commented May 10, 2015

Also tested shape_event branch and the error message is gone.

@kimci86

This comment has been minimized.

Show comment
Hide comment
@kimci86

kimci86 May 12, 2015

Contributor

I noticed another warning message. As it may not deserve a new github issue, I add a comment here.

Using Ubuntu 14.04 and SFML 2.3, after some keyboard input in a window, changing the keyboard layout (qwerty/azerty) gives the following warning:

X Extensions:
    Generic Event Extension - First event: 0
    SHAPE - First event: 64
    MIT-SHM - First event: 65
    XInputExtension - First event: 66
    XTEST - First event: 0
    BIG-REQUESTS - First event: 0
    SYNC - First event: 83
    XKEYBOARD - First event: 85
    XC-MISC - First event: 0
    SECURITY - First event: 86
    XFIXES - First event: 87
    RENDER - First event: 0
    RANDR - First event: 89
    XINERAMA - First event: 0
    Composite - First event: 0
    DAMAGE - First event: 91
    MIT-SCREEN-SAVER - First event: 92
    DOUBLE-BUFFER - First event: 0
    RECORD - First event: 0
    DPMS - First event: 0
    Present - First event: 0
    DRI3 - First event: 0
    X-Resource - First event: 0
    XVideo - First event: 93
    XFree86-VidModeExtension - First event: 0
    XFree86-DGA - First event: 95
    DRI2 - First event: 102
    GLX - First event: 104
    SGI-GLX - First event: 104
Unhandled event type: 85
Report this to the SFML maintainers if possible
Contributor

kimci86 commented May 12, 2015

I noticed another warning message. As it may not deserve a new github issue, I add a comment here.

Using Ubuntu 14.04 and SFML 2.3, after some keyboard input in a window, changing the keyboard layout (qwerty/azerty) gives the following warning:

X Extensions:
    Generic Event Extension - First event: 0
    SHAPE - First event: 64
    MIT-SHM - First event: 65
    XInputExtension - First event: 66
    XTEST - First event: 0
    BIG-REQUESTS - First event: 0
    SYNC - First event: 83
    XKEYBOARD - First event: 85
    XC-MISC - First event: 0
    SECURITY - First event: 86
    XFIXES - First event: 87
    RENDER - First event: 0
    RANDR - First event: 89
    XINERAMA - First event: 0
    Composite - First event: 0
    DAMAGE - First event: 91
    MIT-SCREEN-SAVER - First event: 92
    DOUBLE-BUFFER - First event: 0
    RECORD - First event: 0
    DPMS - First event: 0
    Present - First event: 0
    DRI3 - First event: 0
    X-Resource - First event: 0
    XVideo - First event: 93
    XFree86-VidModeExtension - First event: 0
    XFree86-DGA - First event: 95
    DRI2 - First event: 102
    GLX - First event: 104
    SGI-GLX - First event: 104
Unhandled event type: 85
Report this to the SFML maintainers if possible

@kimci86 kimci86 changed the title from Minimizing triggers an unhandled event to Minimizing and changing keyboard layout triggers an unhandled event May 12, 2015

@kimci86 kimci86 changed the title from Minimizing and changing keyboard layout triggers an unhandled event to Minimizing and changing the keyboard layout triggers an unhandled event May 12, 2015

@binary1248

This comment has been minimized.

Show comment
Hide comment
@binary1248

binary1248 May 12, 2015

Member

The question now is, should SFML handle keyboard layout changes while an application is running?

@SFML/sfml

Member

binary1248 commented May 12, 2015

The question now is, should SFML handle keyboard layout changes while an application is running?

@SFML/sfml

@eXpl0it3r

This comment has been minimized.

Show comment
Hide comment
@eXpl0it3r

eXpl0it3r May 12, 2015

Member

What does "handle" really mean?

Member

eXpl0it3r commented May 12, 2015

What does "handle" really mean?

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch May 12, 2015

Member

I think binary talks about the switch for character mapping (if any). For example, QWERTZ vs. QWERTY. How should sf::Key::Z and sf::Key::Y react to this (if at all). To be honest, I'm not really sure how/if these change behavior right now nor whether they should (ignoring sf::Event::TextEntered).

Member

MarioLiebisch commented May 12, 2015

I think binary talks about the switch for character mapping (if any). For example, QWERTZ vs. QWERTY. How should sf::Key::Z and sf::Key::Y react to this (if at all). To be honest, I'm not really sure how/if these change behavior right now nor whether they should (ignoring sf::Event::TextEntered).

@binary1248

This comment has been minimized.

Show comment
Hide comment
@binary1248

binary1248 May 12, 2015

Member

"Behave properly". The current implementation caches the keyboard layout so it doesn't have to query an external library every time a keyboard event arrives like it did in the previous Xlib implementation. Xlib took care of the remapping for us, but since we do the translation ourselves now, we will have to take care of mapping changes. It isn't that hard to do, in fact I already know how it would be done. The question is, is it worth writing code that handles a layout switch mid-application? I don't think this happens very often, and even less so when people are playing games.

Member

binary1248 commented May 12, 2015

"Behave properly". The current implementation caches the keyboard layout so it doesn't have to query an external library every time a keyboard event arrives like it did in the previous Xlib implementation. Xlib took care of the remapping for us, but since we do the translation ourselves now, we will have to take care of mapping changes. It isn't that hard to do, in fact I already know how it would be done. The question is, is it worth writing code that handles a layout switch mid-application? I don't think this happens very often, and even less so when people are playing games.

@minirop

This comment has been minimized.

Show comment
Hide comment
@minirop

minirop May 12, 2015

The only reason I can think of changing the layout while playing, is for poorly handled games. (I have a AZERTY keyboard, so I'm playing a game using WASD and I have to select a QWERTY layout so I can play with ZQSD)

minirop commented May 12, 2015

The only reason I can think of changing the layout while playing, is for poorly handled games. (I have a AZERTY keyboard, so I'm playing a game using WASD and I have to select a QWERTY layout so I can play with ZQSD)

@TankOs

This comment has been minimized.

Show comment
Hide comment
@TankOs

TankOs May 13, 2015

Member

@binary1248 It's one less error source, at least.

Member

TankOs commented May 13, 2015

@binary1248 It's one less error source, at least.

binary1248 added a commit that referenced this issue May 20, 2015

Whitelisted SHAPE events that might be sent by some compositing windo…
…w managers even if we didn't select them. Fixes #879
@eXpl0it3r

This comment has been minimized.

Show comment
Hide comment
@eXpl0it3r

eXpl0it3r May 22, 2015

Member

Superseded and fixed by #883

Member

eXpl0it3r commented May 22, 2015

Superseded and fixed by #883

@eXpl0it3r eXpl0it3r closed this May 22, 2015

@eXpl0it3r eXpl0it3r added s:superseded and removed s:accepted labels May 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment