Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4049e66307 | |||
| 046a516a11 | |||
| b5d1e8c3eb | |||
| aee296ad96 | |||
| 5f59db478a | |||
| dda070e84e | |||
| ebbb3b1138 | |||
| 277986bcdf | |||
| 96461cf2aa | |||
| 2029f48b4d | |||
| 943d2de536 | |||
| 5aa7334787 | |||
| 955a138849 | |||
| 44c80a0406 | |||
| 12c9ca1e02 | |||
| 91acfa0138 | |||
| 8d01d17b8c | |||
| 74a5b0937b | |||
| 17ce0b6b46 | |||
| d07b5ed0d6 |
20
Cargo.lock
generated
20
Cargo.lock
generated
@ -59,9 +59,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.61"
|
version = "1.0.65"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d"
|
checksum = "95752358c8f7552394baf48cd82695b345628ad3f170d607de3ca03b8dacca15"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
@ -265,9 +265,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.79"
|
version = "0.2.80"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743"
|
checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linked-hash-map"
|
name = "linked-hash-map"
|
||||||
@ -353,9 +353,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.6.20"
|
version = "0.6.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c"
|
checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rs"
|
name = "rs"
|
||||||
@ -400,9 +400,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_yaml"
|
name = "serde_yaml"
|
||||||
version = "0.8.13"
|
version = "0.8.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ae3e2dd40a7cdc18ca80db804b7f461a39bb721160a85c9a1fa30134bf3c02a5"
|
checksum = "f7baae0a99f1a324984bcdc5f0718384c1f69775f1c7eec8b859b71b443e3fd7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dtoa",
|
"dtoa",
|
||||||
"linked-hash-map",
|
"linked-hash-map",
|
||||||
@ -412,9 +412,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.45"
|
version = "1.0.48"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ea9c5432ff16d6152371f808fb5a871cd67368171b09bb21b43df8e4a47a3556"
|
checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|||||||
@ -21,7 +21,7 @@ views:
|
|||||||
numbers:
|
numbers:
|
||||||
- "1 2 3 4 5 6 7 8 9 0"
|
- "1 2 3 4 5 6 7 8 9 0"
|
||||||
- "@ # € % & - _ + ( )"
|
- "@ # € % & - _ + ( )"
|
||||||
- "show_symbols , \" ' : = < > BackSpace"
|
- "show_symbols ; \" ' : = < > BackSpace"
|
||||||
- "show_letters show_eschars preferences space , . Return"
|
- "show_letters show_eschars preferences space , . Return"
|
||||||
symbols:
|
symbols:
|
||||||
- "~ ` ´ | · √ µ ÷ × ¶"
|
- "~ ` ´ | · √ µ ÷ × ¶"
|
||||||
|
|||||||
@ -21,7 +21,7 @@ views:
|
|||||||
numbers:
|
numbers:
|
||||||
- "1 2 3 4 5 6 7 8 9 0"
|
- "1 2 3 4 5 6 7 8 9 0"
|
||||||
- "@ # % & - _ + ( ) ß"
|
- "@ # % & - _ + ( ) ß"
|
||||||
- "show_symbols , \" ' : = < > BackSpace"
|
- "show_symbols ; \" ' : = < > BackSpace"
|
||||||
- "show_letters preferences space , . Return"
|
- "show_letters preferences space , . Return"
|
||||||
symbols:
|
symbols:
|
||||||
- "~ ` ´ · © ® ÷ × ¶"
|
- "~ ` ´ · © ® ÷ × ¶"
|
||||||
|
|||||||
@ -2,7 +2,7 @@ be Belgjic
|
|||||||
br Brasilian
|
br Brasilian
|
||||||
de Todesc
|
de Todesc
|
||||||
dk Danês
|
dk Danês
|
||||||
es Spgnûl
|
es Spagnûl
|
||||||
fi Finlandês
|
fi Finlandês
|
||||||
fr Francês
|
fr Francês
|
||||||
it+fur Furlan
|
it+fur Furlan
|
||||||
|
|||||||
25
debian/changelog
vendored
25
debian/changelog
vendored
@ -1,3 +1,28 @@
|
|||||||
|
squeekboard (1.11.1) amber-phone; urgency=medium
|
||||||
|
|
||||||
|
[ Mark Müller ]
|
||||||
|
* keyboard: Fix semicolon in German layout
|
||||||
|
* keyboard: Move semicolon in German layout to numbers view replacing redundant comma key
|
||||||
|
|
||||||
|
[ Dorota Czaplejewicz ]
|
||||||
|
* imservice: Set up UI according to current needs when it shows up
|
||||||
|
* UI: Keep visibility factors in a central place
|
||||||
|
* cargo: Update deps
|
||||||
|
|
||||||
|
-- Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Sat, 21 Nov 2020 11:08:06 +0000
|
||||||
|
|
||||||
|
squeekboard (1.11.0) amber-phone; urgency=medium
|
||||||
|
|
||||||
|
[ Dorota Czaplejewicz ]
|
||||||
|
* UI: Delay hiding only when leaving a text field
|
||||||
|
* ui: Cancel hiding delay when activity requested again
|
||||||
|
* Update dependencies
|
||||||
|
|
||||||
|
[ Fabio Tomat ]
|
||||||
|
* Update fur-IT.txt fix typo for Spanish
|
||||||
|
|
||||||
|
-- Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Sat, 14 Nov 2020 06:46:28 +0000
|
||||||
|
|
||||||
squeekboard (1.10.0) amber-phone; urgency=medium
|
squeekboard (1.10.0) amber-phone; urgency=medium
|
||||||
|
|
||||||
[ Dorota Czaplejewicz ]
|
[ Dorota Czaplejewicz ]
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
use std::boxed::Box;
|
use std::boxed::Box;
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
use std::mem;
|
||||||
use std::num::Wrapping;
|
use std::num::Wrapping;
|
||||||
use std::string::String;
|
use std::string::String;
|
||||||
|
|
||||||
@ -41,8 +42,8 @@ pub mod c {
|
|||||||
pub fn eek_input_method_delete_surrounding_text(im: *mut InputMethod, before: u32, after: u32);
|
pub fn eek_input_method_delete_surrounding_text(im: *mut InputMethod, before: u32, after: u32);
|
||||||
pub fn eek_input_method_commit(im: *mut InputMethod, serial: u32);
|
pub fn eek_input_method_commit(im: *mut InputMethod, serial: u32);
|
||||||
fn eekboard_context_service_set_hint_purpose(state: *const StateManager, hint: u32, purpose: u32);
|
fn eekboard_context_service_set_hint_purpose(state: *const StateManager, hint: u32, purpose: u32);
|
||||||
fn server_context_service_show_keyboard(imservice: *const UIManager);
|
pub fn server_context_service_set_im_active(imservice: *const UIManager, active: u32);
|
||||||
fn server_context_service_hide_keyboard(imservice: *const UIManager);
|
pub fn server_context_service_keyboard_release_visibility(imservice: *const UIManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following defined in Rust. TODO: wrap naked pointers to Rust data inside RefCells to prevent multiple writers
|
// The following defined in Rust. TODO: wrap naked pointers to Rust data inside RefCells to prevent multiple writers
|
||||||
@ -152,10 +153,8 @@ pub mod c {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if active_changed {
|
if active_changed {
|
||||||
|
imservice.apply_active_to_ui();
|
||||||
if imservice.current.active {
|
if imservice.current.active {
|
||||||
if let Some(ui) = imservice.ui_manager {
|
|
||||||
unsafe { server_context_service_show_keyboard(ui); }
|
|
||||||
}
|
|
||||||
unsafe {
|
unsafe {
|
||||||
eekboard_context_service_set_hint_purpose(
|
eekboard_context_service_set_hint_purpose(
|
||||||
imservice.state_manager,
|
imservice.state_manager,
|
||||||
@ -163,10 +162,6 @@ pub mod c {
|
|||||||
imservice.current.content_purpose.clone() as u32,
|
imservice.current.content_purpose.clone() as u32,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if let Some(ui) = imservice.ui_manager {
|
|
||||||
unsafe { server_context_service_hide_keyboard(ui); }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -185,7 +180,7 @@ pub mod c {
|
|||||||
imservice.current.active = false;
|
imservice.current.active = false;
|
||||||
|
|
||||||
if let Some(ui) = imservice.ui_manager {
|
if let Some(ui) = imservice.ui_manager {
|
||||||
unsafe { server_context_service_hide_keyboard(ui); }
|
unsafe { server_context_service_keyboard_release_visibility(ui); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,7 +335,7 @@ pub struct IMService {
|
|||||||
/// Unowned reference. Be careful, it's shared with C at large
|
/// Unowned reference. Be careful, it's shared with C at large
|
||||||
state_manager: *const c::StateManager,
|
state_manager: *const c::StateManager,
|
||||||
/// Unowned reference. Be careful, it's shared with C at large
|
/// Unowned reference. Be careful, it's shared with C at large
|
||||||
pub ui_manager: Option<*const c::UIManager>,
|
ui_manager: Option<*const c::UIManager>,
|
||||||
|
|
||||||
pending: IMProtocolState,
|
pending: IMProtocolState,
|
||||||
current: IMProtocolState, // turn current into an idiomatic representation?
|
current: IMProtocolState, // turn current into an idiomatic representation?
|
||||||
@ -377,7 +372,27 @@ impl IMService {
|
|||||||
}
|
}
|
||||||
imservice
|
imservice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_ui_manager(&mut self, mut ui_manager: Option<*const c::UIManager>) {
|
||||||
|
mem::swap(&mut self.ui_manager, &mut ui_manager);
|
||||||
|
// Now ui_manager is what was previously self.ui_manager.
|
||||||
|
// If there wasn't any, we need to consider if UI was requested.
|
||||||
|
if let None = ui_manager {
|
||||||
|
self.apply_active_to_ui();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn apply_active_to_ui(&self) {
|
||||||
|
if let Some(ui) = self.ui_manager {
|
||||||
|
unsafe {
|
||||||
|
c::server_context_service_set_im_active(
|
||||||
|
ui,
|
||||||
|
self.is_active() as u32,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn commit_string(&self, text: &CString) -> Result<(), SubmitError> {
|
pub fn commit_string(&self, text: &CString) -> Result<(), SubmitError> {
|
||||||
match self.current.active {
|
match self.current.active {
|
||||||
true => {
|
true => {
|
||||||
|
|||||||
@ -46,6 +46,7 @@ struct _ServerContextService {
|
|||||||
|
|
||||||
gboolean visible;
|
gboolean visible;
|
||||||
gboolean enabled;
|
gboolean enabled;
|
||||||
|
gboolean im_active;
|
||||||
PhoshLayerSurface *window;
|
PhoshLayerSurface *window;
|
||||||
GtkWidget *widget; // nullable
|
GtkWidget *widget; // nullable
|
||||||
guint hiding;
|
guint hiding;
|
||||||
@ -226,27 +227,9 @@ make_widget (ServerContextService *self)
|
|||||||
gtk_widget_show_all(self->widget);
|
gtk_widget_show_all(self->widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
on_hide (ServerContextService *self)
|
|
||||||
{
|
|
||||||
gtk_widget_hide (GTK_WIDGET(self->window));
|
|
||||||
self->hiding = 0;
|
|
||||||
|
|
||||||
return G_SOURCE_REMOVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
server_context_service_real_show_keyboard (ServerContextService *self)
|
server_context_service_real_show_keyboard (ServerContextService *self)
|
||||||
{
|
{
|
||||||
if (!self->enabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self->hiding) {
|
|
||||||
g_source_remove (self->hiding);
|
|
||||||
self->hiding = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!self->window) {
|
if (!self->window) {
|
||||||
make_window (self);
|
make_window (self);
|
||||||
}
|
}
|
||||||
@ -260,17 +243,29 @@ server_context_service_real_show_keyboard (ServerContextService *self)
|
|||||||
static void
|
static void
|
||||||
server_context_service_real_hide_keyboard (ServerContextService *self)
|
server_context_service_real_hide_keyboard (ServerContextService *self)
|
||||||
{
|
{
|
||||||
if (!self->hiding) {
|
gtk_widget_hide (GTK_WIDGET(self->window));
|
||||||
self->hiding = g_timeout_add (200, (GSourceFunc) on_hide, self);
|
|
||||||
}
|
|
||||||
self->visible = FALSE;
|
self->visible = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
on_hide (ServerContextService *self)
|
||||||
|
{
|
||||||
|
server_context_service_real_hide_keyboard(self);
|
||||||
|
self->hiding = 0;
|
||||||
|
|
||||||
|
return G_SOURCE_REMOVE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
server_context_service_show_keyboard (ServerContextService *self)
|
server_context_service_show_keyboard (ServerContextService *self)
|
||||||
{
|
{
|
||||||
g_return_if_fail (SERVER_IS_CONTEXT_SERVICE(self));
|
g_return_if_fail (SERVER_IS_CONTEXT_SERVICE(self));
|
||||||
|
|
||||||
|
if (self->hiding) {
|
||||||
|
g_source_remove (self->hiding);
|
||||||
|
self->hiding = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!self->visible) {
|
if (!self->visible) {
|
||||||
server_context_service_real_show_keyboard (self);
|
server_context_service_real_show_keyboard (self);
|
||||||
}
|
}
|
||||||
@ -286,6 +281,22 @@ server_context_service_hide_keyboard (ServerContextService *self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Meant for use by the input-method handler:
|
||||||
|
/// the visible keyboard is no longer needed.
|
||||||
|
/// The implementation will delay it slightly,
|
||||||
|
/// because the release may be due to switching from one text field to another.
|
||||||
|
/// In this case, the user doesn't really need the keyboard surface
|
||||||
|
/// to disappear completely.
|
||||||
|
void
|
||||||
|
server_context_service_keyboard_release_visibility (ServerContextService *self)
|
||||||
|
{
|
||||||
|
g_return_if_fail (SERVER_IS_CONTEXT_SERVICE(self));
|
||||||
|
|
||||||
|
if (!self->hiding && self->visible) {
|
||||||
|
self->hiding = g_timeout_add (200, (GSourceFunc) on_hide, self);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
server_context_service_set_property (GObject *object,
|
server_context_service_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
@ -406,12 +417,27 @@ server_context_service_new (EekboardContextService *self, struct submission *sub
|
|||||||
return ui;
|
return ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
server_context_service_update_visible (ServerContextService *self, gboolean delay) {
|
||||||
|
if (self->enabled && self->im_active) {
|
||||||
|
server_context_service_show_keyboard(self);
|
||||||
|
} else if (delay) {
|
||||||
|
server_context_service_keyboard_release_visibility(self);
|
||||||
|
} else {
|
||||||
|
server_context_service_hide_keyboard(self);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
server_context_service_set_enabled (ServerContextService *self, gboolean enabled)
|
server_context_service_set_enabled (ServerContextService *self, gboolean enabled)
|
||||||
{
|
{
|
||||||
g_return_if_fail (SERVER_IS_CONTEXT_SERVICE (self));
|
g_return_if_fail (SERVER_IS_CONTEXT_SERVICE (self));
|
||||||
self->enabled = enabled;
|
self->enabled = enabled;
|
||||||
if (!self->enabled) {
|
server_context_service_update_visible(self, FALSE);
|
||||||
server_context_service_hide_keyboard (self);
|
}
|
||||||
}
|
|
||||||
|
void
|
||||||
|
server_context_service_set_im_active(ServerContextService *self, uint32_t active) {
|
||||||
|
self->im_active = active;
|
||||||
|
server_context_service_update_visible(self, TRUE);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,11 +84,11 @@ pub mod c {
|
|||||||
}
|
}
|
||||||
let submission: &mut Submission = unsafe { &mut *submission };
|
let submission: &mut Submission = unsafe { &mut *submission };
|
||||||
if let Some(ref mut imservice) = &mut submission.imservice {
|
if let Some(ref mut imservice) = &mut submission.imservice {
|
||||||
imservice.ui_manager = if ui_manager.is_null() {
|
imservice.set_ui_manager(if ui_manager.is_null() {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(ui_manager)
|
Some(ui_manager)
|
||||||
}
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user