Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Evangelos Ribeiro Tzaras
chatty
Commits
3fb670ae
Commit
3fb670ae
authored
Aug 15, 2020
by
Mohammed Sadiq
Browse files
application: Show main window on clicking notification
parent
b19f9aa8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/chatty-application.c
View file @
3fb670ae
...
...
@@ -201,6 +201,19 @@ application_open_uri (ChattyApplication *self)
return
G_SOURCE_REMOVE
;
}
static
void
chatty_application_show_window
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
gpointer
user_data
)
{
ChattyApplication
*
self
=
user_data
;
g_assert
(
CHATTY_IS_APPLICATION
(
self
));
g_application_activate
(
G_APPLICATION
(
self
));
gtk_window_present
(
GTK_WINDOW
(
self
->
main_window
));
}
static
void
chatty_application_finalize
(
GObject
*
object
)
{
...
...
@@ -279,6 +292,9 @@ chatty_application_startup (GApplication *application)
{
ChattyApplication
*
self
=
(
ChattyApplication
*
)
application
;
g_autofree
char
*
db_path
=
NULL
;
static
const
GActionEntry
app_entries
[]
=
{
{
"show-window"
,
chatty_application_show_window
},
};
self
->
daemon
=
FALSE
;
self
->
manager
=
g_object_ref
(
chatty_manager_get_default
());
...
...
@@ -297,6 +313,9 @@ chatty_application_startup (GApplication *application)
gtk_css_provider_load_from_resource
(
self
->
css_provider
,
"/sm/puri/chatty/css/style.css"
);
g_action_map_add_action_entries
(
G_ACTION_MAP
(
self
),
app_entries
,
G_N_ELEMENTS
(
app_entries
),
self
);
gtk_style_context_add_provider_for_screen
(
gdk_screen_get_default
(),
GTK_STYLE_PROVIDER
(
self
->
css_provider
),
GTK_STYLE_PROVIDER_PRIORITY_USER
);
...
...
src/chatty-notify.c
View file @
3fb670ae
...
...
@@ -52,6 +52,7 @@ chatty_notify_show_notification (const char *title,
application
=
g_application_get_default
();
notification
=
g_notification_new
(
"chatty"
);
g_notification_set_default_action
(
notification
,
"app.show-window"
);
if
(
pixbuf
)
{
icon
=
chatty_icon_get_gicon_from_pixbuf
(
pixbuf
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment