Re: [gtk-osx-users] getting a signal when the dock icon is clicked on

Hi Antoine,

Clicking the app dock icon or double clicking the app in Finder generates a reopen event, which causes the 
NSApplication delegate to receive the applicationShouldHandleReopen:hasVisibleWindows: message.

You could add support for this to gtkosxapplication_quartz.c and GtkApplicationDelegate.[hc] and make a pull 

For now, the simple way to handle this is to just link a category on GtkApplicationDelegate.
You might want to use g_signal_emit(), like GtkApplicationDelegate does.

// GtkApplicationDelegate_Additions.m

#include "GtkApplicationDelegate.h"
extern void handle_dock_icon_clicked();

@implementation GtkApplicationDelegate (GtkApplicationDelegate_Additions)

- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication
    return YES;


On Mar 15, 2016, at 10:54 PM, Antoine Martin <antoine nagafix co uk> wrote:


I would like to get notified when the dock is clicked on, so that I can
restore any windows currently minimized. (that's the expected behaviour
on OSX apparently)

The only signal I can listen for that fires when one clicks on the dock
is the "NSApplicationDidBecomeActive", but that's not really what I am
looking for since it will also fire in other cases.
Am I missing something?
Is anyone already doing this in other gtk-osx applications?

Gtk-osx-users-list mailing list
Gtk-osx-users-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]