Commit Graph

89 Commits

Author SHA1 Message Date
Matthias Clasen
585a6652d5 Use G_SOURCE_CONTINUE/REMOVE
Now that GLib provides these macros, we should use them
to make the code more readable.
2012-01-30 19:12:27 -05:00
Cosimo Cecchi
c76cccd437 application: sync clipboard and recent manager on shutdown
This mimics the code for gtk_main(), since GApplication iterates the
main context directly.
2012-01-25 18:31:25 -05:00
Matthias Clasen
7d56c052d4 Fix a doc typo 2012-01-24 22:28:34 -05:00
Matthias Clasen
e7d6400149 GtkApplication: documentation additions
Document that startup() needs to chain up first.
2012-01-24 22:22:08 -05:00
Matthias Clasen
284ff06ef6 GtkApplication: fix !x11 build
Since we moved the menu models to GTK+, we need to deal with
them on all platforms, even if we don't do anything special
with them on win32.
2012-01-20 08:16:35 -05:00
Ryan Lortie
60317cbf1a move menus over from GLib
App menu and menubar are now properties of GtkApplication and their bus
location is exported using X window properties.

https://bugzilla.gnome.org/show_bug.cgi?id=668118
2012-01-18 13:40:05 -05:00
Javier Jardón
c958667a92 gtkapplication.c: Add missing "Since" tag 2012-01-12 12:58:56 +00:00
Dan Winship
05c484dcb0 GtkApplication: add inhibitor dialog under OS X
Since OS X doesn't have an inhibitors API, we need to display the
inhibit reason ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=667705
2012-01-11 12:00:06 -05:00
Dan Winship
7afc7081c1 GtkApplication: fix/simplify OS X implementation
Make the OS X implementation compile, and remove the code that was
only needed to support user interaction during the quit request.

https://bugzilla.gnome.org/show_bug.cgi?id=667705
2012-01-11 12:00:06 -05:00
Rico Tzschichholz
f24dd8f067 Fix some missing renames of GtkApplicationEndStyle 2012-01-11 08:49:34 +01:00
Matthias Clasen
7c0c65ec8d Rename GtkApplicationEndStyle
Call it EndSession to make it clearer what this is about.
2012-01-10 22:16:01 -05:00
Matthias Clasen
1c486fb8b8 Simplify logout notification api
We don't expose ::quit-requested as API anymore. Instead, we expect
users to register inhibitors when needed. Without quit-requested,
there is no need for ::quit-cancelled and gtk_application_quit_response
anymore.

We still emit ::quit when the application is about to quit.
2012-01-10 21:45:30 -05:00
Matthias Clasen
9cb4518a24 Fix wrong refencences in the docs
Replace all references to g_application_set_app_menu and
g_application_set_menubar by their gtk variants, which
actually exist. Pointed out in bug 667546
2012-01-09 17:30:09 -05:00
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