Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Librem5
squeekboard
Commits
4eb59ba7
Commit
4eb59ba7
authored
Mar 10, 2011
by
Daiki Ueno
Browse files
Display client name as window title.
parent
cc9fb31e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/server-context.c
View file @
4eb59ba7
...
...
@@ -94,6 +94,7 @@ struct _ServerContext {
guint
registration_id
;
char
*
object_path
;
char
*
client_connection
;
char
*
client_name
;
gboolean
enabled
;
gboolean
last_keyboard_visible
;
...
...
@@ -285,7 +286,10 @@ update_widget (ServerContext *context)
gtk_widget_set_can_focus
(
context
->
window
,
FALSE
);
g_object_set
(
G_OBJECT
(
context
->
window
),
"accept_focus"
,
FALSE
,
NULL
);
gtk_window_set_title
(
GTK_WINDOW
(
context
->
window
),
_
(
"Keyboard"
));
gtk_window_set_title
(
GTK_WINDOW
(
context
->
window
),
context
->
client_name
?
context
->
client_name
:
_
(
"Keyboard"
));
gtk_window_set_icon_name
(
GTK_WINDOW
(
context
->
window
),
"eekboard"
);
gtk_window_set_keep_above
(
GTK_WINDOW
(
context
->
window
),
TRUE
);
...
...
@@ -372,6 +376,7 @@ server_context_finalize (GObject *object)
g_free
(
context
->
object_path
);
g_free
(
context
->
client_connection
);
g_free
(
context
->
client_name
);
G_OBJECT_CLASS
(
server_context_parent_class
)
->
finalize
(
object
);
}
...
...
@@ -797,6 +802,7 @@ void
server_context_set_client_connection
(
ServerContext
*
context
,
const
gchar
*
client_connection
)
{
g_free
(
context
->
client_connection
);
context
->
client_connection
=
g_strdup
(
client_connection
);
}
...
...
@@ -805,3 +811,11 @@ server_context_get_client_connection (ServerContext *context)
{
return
context
->
client_connection
;
}
void
server_context_set_client_name
(
ServerContext
*
context
,
const
gchar
*
client_name
)
{
g_free
(
context
->
client_name
);
context
->
client_name
=
g_strdup
(
client_name
);
}
src/server-context.h
View file @
4eb59ba7
...
...
@@ -43,6 +43,9 @@ void server_context_set_client_connection
const
gchar
*
client_connection
);
const
gchar
*
server_context_get_client_connection
(
ServerContext
*
context
);
void
server_context_set_client_name
(
ServerContext
*
context
,
const
gchar
*
client_name
);
G_END_DECLS
#endif
/* SERVER_CONTEXT_H */
src/server-server.c
View file @
4eb59ba7
...
...
@@ -321,6 +321,7 @@ handle_method_call (GDBusConnection *connection,
object_path
=
g_strdup_printf
(
SERVER_CONTEXT_PATH
,
context_id
++
);
context
=
server_context_new
(
object_path
,
server
->
connection
);
server_context_set_client_connection
(
context
,
sender
);
server_context_set_client_name
(
context
,
client_name
);
g_hash_table_insert
(
server
->
context_hash
,
object_path
,
context
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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