Mercurial > audlegacy
annotate src/libeggsmclient/eggsmclient-osx.c @ 4346:6a87d1c1da32
remove more ui_* references
author | mf0102 <0102@gmx.at> |
---|---|
date | Sat, 15 Mar 2008 00:26:49 +0100 |
parents | c942eaef7bc6 |
children |
rev | line source |
---|---|
4315
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
1 /* |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
2 * Copyright (C) 2007 Novell, Inc. |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
3 * |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
4 * This library is free software; you can redistribute it and/or |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
5 * modify it under the terms of the GNU Library General Public |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
6 * License as published by the Free Software Foundation; either |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
7 * version 2 of the License, or (at your option) any later version. |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
8 * |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
9 * This library is distributed in the hope that it will be useful, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
12 * Library General Public License for more details. |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
13 * |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
14 * You should have received a copy of the GNU Library General Public |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
15 * License along with this library; if not, write to the |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
17 * Boston, MA 02111-1307, USA. |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
18 */ |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
19 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
20 #include "config.h" |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
21 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
22 #define G_LOG_DOMAIN "EggSMClient" |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
23 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
24 #include "eggsmclient.h" |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
25 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
26 #define EGG_TYPE_SM_CLIENT_OSX (egg_sm_client_osx_get_type ()) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
27 #define EGG_SM_CLIENT_OSX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSX)) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
28 #define EGG_SM_CLIENT_OSX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSXClass)) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
29 #define EGG_IS_SM_CLIENT_OSX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_OSX)) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
30 #define EGG_IS_SM_CLIENT_OSX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_OSX)) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
31 #define EGG_SM_CLIENT_OSX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSXClass)) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
32 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
33 typedef struct _EggSMClientOSX EggSMClientOSX; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
34 typedef struct _EggSMClientOSXClass EggSMClientOSXClass; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
35 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
36 struct _EggSMClientOSX { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
37 EggSMClient parent; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
38 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
39 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
40 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
41 struct _EggSMClientOSXClass |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
42 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
43 EggSMClientClass parent_class; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
44 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
45 }; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
46 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
47 static void sm_client_osx_startup (EggSMClient *client, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
48 const char *client_id); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
49 static void sm_client_osx_will_quit (EggSMClient *client, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
50 gboolean will_quit); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
51 static gboolean sm_client_osx_end_session (EggSMClient *client, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
52 EggSMClientEndStyle style, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
53 gboolean request_confirmation); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
54 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
55 static GdkFilterReturn sm_client_osx_filter (GdkXEvent *xevent, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
56 GdkEvent *event, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
57 gpointer data); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
58 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
59 G_DEFINE_TYPE (EggSMClientOSX, egg_sm_client_osx, EGG_TYPE_SM_CLIENT) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
60 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
61 static void |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
62 egg_sm_client_osx_init (EggSMClientOSX *osxclient) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
63 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
64 ; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
65 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
66 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
67 static void |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
68 egg_sm_client_osx_class_init (EggSMClientOSXClass *klass) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
69 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
70 EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
71 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
72 sm_client_class->startup = sm_client_osx_startup; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
73 sm_client_class->will_quit = sm_client_osx_will_quit; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
74 sm_client_class->end_session = sm_client_osx_end_session; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
75 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
76 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
77 EggSMClient * |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
78 egg_sm_client_osx_new (void) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
79 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
80 return g_object_new (EGG_TYPE_SM_CLIENT_OSX, NULL); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
81 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
82 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
83 static void |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
84 sm_client_osx_startup (EggSMClient *client) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
85 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
86 gdk_window_add_filter (NULL, sm_client_osx_filter, client); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
87 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
88 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
89 void |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
90 sm_client_osx_will_quit (EggSMClient *client, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
91 gboolean will_quit) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
92 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
93 EggSMClientOSX *osxclient = (EggSMClientOSX *)client; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
94 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
95 if (will_quit) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
96 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
97 /* OS X doesn't send another message. We're supposed to just |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
98 * quit after agreeing that it's OK. |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
99 * |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
100 * FIXME: do it from an idle handler though. |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
101 */ |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
102 egg_sm_client_quit (client); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
103 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
104 else |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
105 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
106 /* FIXME: "respond to the event by returning a userCancelledErr |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
107 * error" |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
108 */ |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
109 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
110 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
111 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
112 void |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
113 sm_client_osx_end_session (EggSMClient *client, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
114 EggSMClientEndStyle style, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
115 gboolean request_confirmation) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
116 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
117 EggSMClientOSX *osxclient = (EggSMClientOSX *)client; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
118 FIXME_t event; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
119 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
120 switch (style) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
121 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
122 case EGG_SM_CLIENT_END_SESSION_DEFAULT: |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
123 case EGG_SM_CLIENT_END_LOGOUT: |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
124 event = request_confirmation ? kAELogOut : kAEReallyLogOut; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
125 break; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
126 case EGG_SM_CLIENT_END_REBOOT: |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
127 event = request_confirmation ? kAEShowRestartDialog : kAERestart; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
128 break; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
129 case EGG_SM_CLIENT_END_SHUTDOWN: |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
130 event = request_confirmation ? kAEShowShutdownDialog : kAEShutDown; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
131 break; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
132 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
133 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
134 /* FIXME: send event to loginwindow process */ |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
135 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
136 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
137 static GdkFilterReturn |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
138 egg_sm_client_osx_filter (GdkXEvent *xevent, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
139 GdkEvent *event, |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
140 gpointer data) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
141 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
142 EggSMClientOSX *osxclient = data; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
143 EggSMClient *client = data; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
144 NSEvent *nsevent = (NSEvent *)xevent; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
145 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
146 switch (FIXME_get_apple_event_type (nsevent)) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
147 { |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
148 case kAEQuitApplication: |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
149 if (FIXME_app_is_a_foreground_app) |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
150 egg_sm_client_quit_requested (client); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
151 else |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
152 egg_sm_client_quit (client); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
153 return GDK_FILTER_REMOVE; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
154 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
155 default: |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
156 return GDK_FILTER_CONTINUE; |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
157 } |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
diff
changeset
|
158 } |