Commit Graph

76 Commits

Author SHA1 Message Date
Rob Bradford
4007449a58 application: Correct the fallback definition for gtk_application_end_session
The function definition used a pointer to the enum value rather than the enum
itself.

This broke the build on platforms that don't have an implmentation of these
functions.
2012-01-09 15:09:27 +00:00
Matthias Clasen
f3533e4fc2 Fix the gtk_application_end_session implementation
We were passing the wrong flags, causing the meaning of
the request_confirmation parameter to be inverted.
2012-01-08 02:16:26 -05:00
Matthias Clasen
f78696f3d0 GtkApplication: only allow quit_response when it make sense
This check was present in the OS X implementation, but it
makes sense in the D-Bus implementation as well.
2012-01-07 20:01:23 -05:00
Matthias Clasen
00d5214695 Remove some debug spew 2012-01-07 19:55:20 -05:00
Matthias Clasen
bb957e5389 GtkApplication: Add OS X implementation from EggSMClient 2012-01-07 19:52:14 -05:00
Benjamin Otte
f6d2f4fa8d application: return a value 2012-01-07 15:56:26 +01:00
Martin Pitt
700a334d87 gtkapplication.c: Fix syntax error
Previous commit accidentally removed the closing } from
gtk_application_end_session(). Add it back to unbreak the build.
2012-01-07 10:04:18 +01:00
Matthias Clasen
916009b5d6 Add a trivial implementation of the new apis
For non-X11, this is just a placeholder until we get around
to moving the EggSMClient implementations over.
2012-01-07 03:20:56 -05:00
Matthias Clasen
48872705f0 Document the new apis 2012-01-07 03:20:56 -05:00
Matthias Clasen
3142d13972 Add gtk_application_end_session
This function allows applications to request that
the user session be ended by logout/shutdown/reboot.
2012-01-07 03:20:56 -05:00
Matthias Clasen
bdd7e15c84 GtkApplication: Add an inhibit api
This lets applications block logout and similar actions ahead
of time. Currently only implemented for D-Bus, but Windows has
very similar API since Vista.
2012-01-07 03:20:56 -05:00
Matthias Clasen
3133791302 GtkApplication: Add logout notification
This is fairly basic, allowing applications to learn when
the session manager is about to end the session, and possibly
block this. The only implementation at this point is using the
org.gnome.SessionManager D-Bus interface of gnome-session. It should
be straightforward to port the EggSMClient implementations for
Windows and OS X.
2012-01-07 03:20:56 -05:00
Matthias Clasen
7df5cf2a3a GtkApplication: Rename a member for clarity
'session' is a bit ambiguous (and GtkApplication may grow session
management support at some point), so rename the bus connection
to 'session_bus'.
2012-01-05 23:53:40 -05:00
Cosimo Cecchi
157d9271fa application: don't unconditionally unref the GMenuModel in getters
Both the app-menu and menubar models can be NULL, so we shouldn't
blindly unref them, since g_object_unref() doesn't cope with NULL
pointers.
2011-12-21 12:20:15 +01:00
Cosimo Cecchi
72c04c064a application: mark menu/menubar getters as (transfer none)
Since they do not return a reference to the underlying GMenuModel.
2011-12-21 12:19:31 +01:00
Cosimo Cecchi
9ae0ffb9cb application: use the same variable names in definitions and declarations
gobject-introspection will be confused and mark the methods as not
introspectable otherwise.
2011-12-21 11:29:39 +01:00
Matthias Clasen
5d8641dd92 Add another bloatpad screenshot 2011-12-19 15:16:11 -05:00
Ryan Lortie
8578fefaa5 GtkApplication: add menu API
We add the app-menu and menubar public APIs to GtkApplication while
leaving the implementation in GApplication.

The actual implementation will be moved soon.
2011-12-19 12:51:12 -05:00
Ryan Lortie
06c8921975 GtkApplication: document relationship to gdkthreads 2011-12-19 12:51:12 -05:00
Ryan Lortie
363c2d684c GtkApplication: lock gdk on incoming messages
When we have incoming activations or action invocations we should
acquire the GDK lock, just in case the program in question is using gdk
threads.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-19 12:51:12 -05:00
Ryan Lortie
76d671d6a2 Move X property handling to GtkApplicationWindow
Don't try to deal with this using a qdata and signal connections in
GtkApplication.
2011-12-19 12:51:12 -05:00
Matthias Clasen
cff5ba1bc2 Document that gtk_init is called without argv
This answers a question in bug 661823.
2011-12-19 12:51:12 -05:00
Matthias Clasen
080007d7cb Show off some menus 2011-12-19 12:51:12 -05:00
Matthias Clasen
06a75b7e1f Some more menu-related docs 2011-12-19 12:51:12 -05:00
Matthias Clasen
3103ae2685 Two small fixes
Don't leak a session bus reference, and don't assume a display
is X11 just because we've built the X11 backend.
2011-12-19 12:51:12 -05:00
William Hua
8bc7513a7b begin GtkApplication menu support for Mac OS 2011-12-19 12:51:11 -05:00
Matthias Clasen
f485dd3f08 Documentation additions 2011-12-19 12:51:11 -05:00
Matthias Clasen
f7244431a9 GtkApplication: Extract accelerators from menus
This allows to specify accelerators in a convenient way, by
adding accel="..." attributes to the menu items in the
XML for the menu.

Currently, the accelerators are extracted only once, when the
menu property is changed on the application.
2011-12-19 12:51:11 -05:00
Matthias Clasen
2398d7e900 Introduce gtkaccelmapprivate.h
Move internal accel map API there and update all users.
Also, add an internal function to create an accel path for
an action and parameter, and use it in gtkapplication.c and
gtkmodelmenuitem.c instead of duplicating that code.
2011-12-19 12:51:11 -05:00
Matthias Clasen
153cc818db GtkApplication: Add API to install accelerators for actions 2011-12-19 12:51:11 -05:00
Ryan Lortie
90fcf994d5 GtkApplication: export windows on the bus
And advertise their location on the bus using X11 properties.
2011-12-19 12:51:11 -05:00
Ryan Lortie
03db3e1ca1 (trivially) implement 'shutdown' in GtkApplication 2011-12-19 12:51:11 -05:00
Matthias Clasen
7ef340fb87 Clean up includes 2011-12-19 12:51:10 -05:00
Matthias Clasen
0683f086bb Whitespace fixes 2011-12-19 12:51:09 -05:00
Matthias Clasen
d9c3714fcb GtkApplication: doc improvement 2011-12-19 12:51:08 -05:00
Ryan Lortie
a93b9dd1cb add GtkApplicationWindow
This is a GtkWindow subclass that "application windows" will use.  Each
is associated with a GtkApplication, has the ability to show menus and
will have its own associated set of actions.
2011-12-19 12:51:08 -05:00
Matthias Clasen
6b7be4a3a2 Add a very bad fallback check
...maybe committing this inspires some better solution.
2011-12-19 12:51:07 -05:00
Matthias Clasen
5705a330c2 GtkApplication: Insert separators after sections
The previous code was only inserting a separator when a new
section was starting right away, which may not always be the
case.
2011-12-19 12:45:51 -05:00
Matthias Clasen
5aee67793f GtkApplication: Initial attempt at section headings
This should be redone to show the label together with the
separator line, somehow. For now, just put the label below
the separator, as a separate item.
2011-12-19 12:45:51 -05:00
Matthias Clasen
92af3d04b8 GtkApplication: use activate for actions here, too 2011-12-19 12:45:51 -05:00
Matthias Clasen
95d9a5e368 Adapt to api changes in GMenuModel 2011-12-19 12:45:51 -05:00
Matthias Clasen
cc24dbe9c7 GtkApplication: add a way to get the appmenu
This function either returns a GtkMenu or NULL.
Still to do: detect if the app menu is externally handled.
2011-12-19 12:45:51 -05:00
Javier Jardón
5c6656e485 gtk/gtkapplication.c: Fix typo 2011-11-20 23:05:47 +00:00
Matthias Clasen
190c271986 Add a missing include 2011-11-09 22:03:10 -05:00
Ryan Lortie
7e22a5350c Don't implement GApplication mainloop
Let the default GApplication implementation take care of it.

https://bugzilla.gnome.org/show_bug.cgi?id=658805
2011-11-09 00:22:52 -05:00
Ryan Lortie
f86351c05f GtkApplication: chain up ::startup 2011-09-14 14:04:10 -04:00
Claudio Saavedra
c3b7590c77 Avoid GApplication being released twice on gtk_application_remove_window() calls
Removing the window from the window list before setting the
application to %NULL avoids gtk_application_remove_window() triggering
another call to gtk_application_window_removed(), which would release
the application a second time.

https://bugzilla.gnome.org/show_bug.cgi?id=653053
2011-06-21 00:38:33 +03:00
Matthias Clasen
8143ce69eb GtkApplication: Add window-added/-removed signals
This is useful to let unrelated parts of an application (or
plugins) learn about the windows of an application. Based
on a patch by Matt Barnes,
https://bugzilla.gnome.org/show_bug.cgi?id=641087
2011-05-31 19:12:13 -04:00
Matthias Clasen
75390b2d60 Sort GtkApplication windows by most-recently-focused
Based on a patch by Matt Barnes,
https://bugzilla.gnome.org/show_bug.cgi?id=624539
2011-05-31 18:28:55 -04:00
Matthias Clasen
7db4bee4b6 Clarify documentation about application vs window lifecycle
https://bugzilla.gnome.org/show_bug.cgi?id=639931
2011-01-24 22:20:35 -05:00