Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-1687

Mac: Suggestion for having the possiblity to get all native system events

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • P3: Somewhat important
    • Some future release
    • 4.3.3
    • Core: Event loop
    • None
    • macOS

    Description

      On Windows it seems that it is possible to get pretty much get any event by using QCoreApplication::winEventFilter. On Mac however
      it seems that Qt only register a subset of events (see
      qapplication_mac.cpp). That is fine however it would be great if we
      could still use the Carbon call: AddEventTypesToHandler, to do something
      like this:

      EventTypeSpec switchEventTypes[2];
      switchEventTypes[0].eventClass = kEventClassSystem;
      switchEventTypes[0].eventKind = kEventSystemUserSessionDeactivated;
      switchEventTypes[1].eventClass = kEventClassSystem;
      switchEventTypes[1].eventKind = kEventSystemUserSessionActivated;

      OSStatus err= AddEventTypesToHandler (app_proc_handler, 2,
      switchEventTypes);

      Unfortunately it does not seem possible because app_proc_handler is a
      static and is not exposed through any interface I could find. Instead
      one has to re-create a separate Event Handler.

      This would be useful for detecting user switching, changes in network configuration, when the computer is put to sleep/woken up.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes