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
4890c86b
Commit
4890c86b
authored
Dec 15, 2020
by
Dorota Czaplejewicz
Browse files
dbus: Reset hints if text input missing
parent
b72c6b53
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/dbus.c
View file @
4890c86b
...
...
@@ -59,7 +59,7 @@ handle_set_visible(SmPuriOSK0 *object, GDBusMethodInvocation *invocation,
if
(
service
->
context
)
{
if
(
arg_visible
)
{
server_context_service_show_keyboard
(
service
->
context
);
server_context_service_
force_
show_keyboard
(
service
->
context
);
}
else
{
server_context_service_hide_keyboard
(
service
->
context
);
}
...
...
src/server-context-service.c
View file @
4890c86b
...
...
@@ -255,7 +255,7 @@ on_hide (ServerContextService *self)
return
G_SOURCE_REMOVE
;
}
void
static
void
server_context_service_show_keyboard
(
ServerContextService
*
self
)
{
g_return_if_fail
(
SERVER_IS_CONTEXT_SERVICE
(
self
));
...
...
@@ -270,6 +270,19 @@ server_context_service_show_keyboard (ServerContextService *self)
}
}
void
server_context_service_force_show_keyboard
(
ServerContextService
*
self
)
{
if
(
!
submission_hint_available
(
self
->
submission
))
{
eekboard_context_service_set_hint_purpose
(
self
->
state
,
ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE
,
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL
);
}
server_context_service_show_keyboard
(
self
);
}
void
server_context_service_hide_keyboard
(
ServerContextService
*
self
)
{
...
...
src/server-context-service.h
View file @
4890c86b
...
...
@@ -31,7 +31,7 @@ G_DECLARE_FINAL_TYPE (ServerContextService, server_context_service, SERVER, CONT
ServerContextService
*
server_context_service_new
(
EekboardContextService
*
self
,
struct
submission
*
submission
,
struct
squeek_layout_state
*
layout
,
struct
ui_manager
*
uiman
,
struct
vis_manager
*
visman
);
enum
squeek_arrangement_kind
server_context_service_get_layout_type
(
ServerContextService
*
);
void
server_context_service_show_keyboard
(
ServerContextService
*
self
);
void
server_context_service_
force_
show_keyboard
(
ServerContextService
*
self
);
void
server_context_service_hide_keyboard
(
ServerContextService
*
self
);
G_END_DECLS
#endif
/* SERVER_CONTEXT_SERVICE_H */
...
...
src/submission.h
View file @
4890c86b
...
...
@@ -17,6 +17,7 @@ struct submission* get_submission(struct zwp_input_method_manager_v2 *immanager,
// Defined in Rust
struct
submission
*
submission_new
(
struct
zwp_input_method_v2
*
im
,
struct
zwp_virtual_keyboard_v1
*
vk
,
EekboardContextService
*
state
,
struct
vis_manager
*
vis_manager
);
uint8_t
submission_hint_available
(
struct
submission
*
self
);
void
submission_set_ui
(
struct
submission
*
self
,
ServerContextService
*
ui_context
);
void
submission_use_layout
(
struct
submission
*
self
,
struct
squeek_layout
*
layout
,
uint32_t
time
);
#endif
src/submission.rs
View file @
4890c86b
...
...
@@ -93,6 +93,18 @@ pub mod c {
let
layout
=
unsafe
{
&*
layout
};
submission
.use_layout
(
layout
,
Timestamp
(
time
));
}
#[no_mangle]
pub
extern
"C"
fn
submission_hint_available
(
submission
:
*
mut
Submission
)
->
u8
{
if
submission
.is_null
()
{
panic!
(
"Null submission pointer"
);
}
let
submission
:
&
mut
Submission
=
unsafe
{
&
mut
*
submission
};
let
active
=
submission
.imservice
.as_ref
()
.map
(|
imservice
|
imservice
.is_active
());
(
Some
(
true
)
==
active
)
as
u8
}
}
#[derive(Clone,
Copy)]
...
...
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