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

Manage correctly the key combination Ctrl + Tab under macOS #1362

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Alzathar
Copy link

From qutebrowser/qutebrowser#2142 and specifically this comment:

The combination CTRL + Tab is specially handled by OSX/Cocoa text input method.

At least two solutions exists (here and there) to fix the problem. However, the first one use a private/undocumented API. The second is used by this PR.

NOTE: I am not the author of the proposed code.

@Alzathar Alzathar changed the title Manage correctly the key combination Ctrl + Tab under macOS. Manage correctly the key combination Ctrl + Tab under macOS Oct 19, 2018
@intrigus
Copy link

Do you have permission to use the code if you are not the author?
And is it compatible with glfw's license?

@Alzathar
Copy link
Author

@intrigus I've sent an email to the original author to answer to your questions.

@tombsar
Copy link
Contributor

tombsar commented Oct 19, 2018

It looks as though the code in this PR comes from QT, and is protected by a LGPL license. We can not simply copy the code without at minimum keeping the origin, authorship, and license intact. In my opinion (not a lawyer) we cannot include this code at all without explicit written permission from QT (and/or the original author) granting us an unrestricted license that does not carry with it the same responsibilities of the LGPL.

Are the comments included in the patch relevant to GLFW? I notice terms like performKeyEquivalent and QNSView that are unfamiliar, and I suspect may be referring to QT-specific code.

@Alzathar
Copy link
Author

@tombsar performKeyEquivalent: is proposed by Apple in its AppKit API. This is a way to handle keyboard shortcut. You can replace QNSView by NSView (available in AppKit API) as the former inherits from the latter. I will modify the comment if the original author gives the permission to use its code.

@Alzathar
Copy link
Author

Good news, we have the rights to use this code if Qt keeps the copyright!

I proposed to modify the proposed PR as following:

    // The Qt company has all the rights on the following code.
    // The GLFW project has the permission to use it in its source code
    // but the Qt company keeps the copyright
    // The original source code is here: https://codereview.qt-project.org/#/c/161214/1/src/plugins/platforms/cocoa/qnsview.mm
    // =========== QT COPYRIGHT BEGIN =========== //
    // At the moment the only reason we define this method
    // is Ctrl-tab key event never reaching any view at all.
    // ... 
    ...
   // =========== QT COPYRIGHT END =========== //

What do you think?

This PR will be very helpful for Dear ImGui to pass between windows with the CTRL + Tab shortcut. The following comment has a GIF to illustrate the behaviour: ocornut/imgui#787 (comment)

@elmindreda elmindreda self-assigned this Oct 25, 2018
@elmindreda elmindreda added the bug Bug reports and bugfix pull requests label Oct 25, 2018
@elmindreda elmindreda added the verified Reproduced or otherwise verified bugs label Jul 27, 2022
@elmindreda elmindreda added this to Todo in Queue Dec 10, 2023
@elmindreda elmindreda moved this from Todo to 3.5 in Queue Jan 29, 2024
@elmindreda elmindreda added this to the 3.5 milestone Jan 31, 2024
@elmindreda elmindreda removed this from 3.5 in Queue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports and bugfix pull requests macOS verified Reproduced or otherwise verified bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants