Compare commits

...

11 Commits

Author SHA1 Message Date
4049e66307 Release 1.11.1 "Diploid"
Bug fix release:
- Fixes to German layout
- Fixed showing the panel right after starting
2020-11-21 11:09:37 +00:00
046a516a11 cargo: Update deps 2020-11-21 11:03:45 +00:00
b5d1e8c3eb Merge branch 'keyboard-layout-german-move-semicolon' into 'master'
keyboard: Move semicolon in German layout to numbers view replacing redundant comma key

See merge request Librem5/squeekboard!410
2020-11-20 18:33:01 +00:00
aee296ad96 keyboard: Move semicolon in German layout to numbers view replacing redundant comma key 2020-11-20 18:30:35 +01:00
5f59db478a Merge branch 'visible' into 'master'
Manage visibility better

Closes #253

See merge request Librem5/squeekboard!408
2020-11-20 01:57:35 +00:00
dda070e84e Merge branch 'race' into 'master'
imservice: Set up UI according to current needs when it shows up

See merge request Librem5/squeekboard!407
2020-11-19 19:04:22 +00:00
ebbb3b1138 UI: Keep visibility factors in a central place 2020-11-18 19:29:42 +00:00
277986bcdf imservice: Set up UI according to current needs when it shows up 2020-11-18 18:38:24 +00:00
96461cf2aa Merge branch 'keyboard-layout-german-fix-semicolon' into 'master'
keyboard: Fix semicolon in German layout

Closes #226

See merge request Librem5/squeekboard!406
2020-11-14 20:29:56 +00:00
2029f48b4d keyboard: Fix semicolon in German layout 2020-11-14 20:36:23 +01:00
943d2de536 Merge branch '1.11' into 'master'
Release 1.11.0

See merge request Librem5/squeekboard!405
2020-11-14 17:20:44 +00:00
7 changed files with 64 additions and 24 deletions

4
Cargo.lock generated
View File

@ -59,9 +59,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.0.62"
version = "1.0.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40"
checksum = "95752358c8f7552394baf48cd82695b345628ad3f170d607de3ca03b8dacca15"
[[package]]
name = "clap"

View File

@ -21,7 +21,7 @@ views:
numbers:
- "1 2 3 4 5 6 7 8 9 0"
- "@ # € % & - _ + ( )"
- "show_symbols , \" ' : = < > BackSpace"
- "show_symbols ; \" ' : = < > BackSpace"
- "show_letters show_eschars preferences space , . Return"
symbols:
- "~ ` ´ | · √ µ ÷ × ¶"

View File

@ -21,7 +21,7 @@ views:
numbers:
- "1 2 3 4 5 6 7 8 9 0"
- "@ # % & - _ + ( ) ß"
- "show_symbols , \" ' : = < > BackSpace"
- "show_symbols ; \" ' : = < > BackSpace"
- "show_letters preferences space , . Return"
symbols:
- "~ ` ´ · © ® ÷ × ¶"

13
debian/changelog vendored
View File

@ -1,3 +1,16 @@
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 ]

View File

@ -6,6 +6,7 @@
use std::boxed::Box;
use std::ffi::CString;
use std::fmt;
use std::mem;
use std::num::Wrapping;
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_commit(im: *mut InputMethod, serial: u32);
fn eekboard_context_service_set_hint_purpose(state: *const StateManager, hint: u32, purpose: u32);
fn server_context_service_show_keyboard(imservice: *const UIManager);
fn server_context_service_keyboard_release_visibility(imservice: *const UIManager);
pub fn server_context_service_set_im_active(imservice: *const UIManager, active: u32);
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
@ -152,10 +153,8 @@ pub mod c {
};
if active_changed {
imservice.apply_active_to_ui();
if imservice.current.active {
if let Some(ui) = imservice.ui_manager {
unsafe { server_context_service_show_keyboard(ui); }
}
unsafe {
eekboard_context_service_set_hint_purpose(
imservice.state_manager,
@ -163,10 +162,6 @@ pub mod c {
imservice.current.content_purpose.clone() as u32,
);
}
} else {
if let Some(ui) = imservice.ui_manager {
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
state_manager: *const c::StateManager,
/// 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,
current: IMProtocolState, // turn current into an idiomatic representation?
@ -378,6 +373,26 @@ impl 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> {
match self.current.active {
true => {

View File

@ -46,6 +46,7 @@ struct _ServerContextService {
gboolean visible;
gboolean enabled;
gboolean im_active;
PhoshLayerSurface *window;
GtkWidget *widget; // nullable
guint hiding;
@ -229,10 +230,6 @@ make_widget (ServerContextService *self)
static void
server_context_service_real_show_keyboard (ServerContextService *self)
{
if (!self->enabled) {
return;
}
if (!self->window) {
make_window (self);
}
@ -420,12 +417,27 @@ server_context_service_new (EekboardContextService *self, struct submission *sub
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
server_context_service_set_enabled (ServerContextService *self, gboolean enabled)
{
g_return_if_fail (SERVER_IS_CONTEXT_SERVICE (self));
self->enabled = enabled;
if (!self->enabled) {
server_context_service_hide_keyboard (self);
}
server_context_service_update_visible(self, FALSE);
}
void
server_context_service_set_im_active(ServerContextService *self, uint32_t active) {
self->im_active = active;
server_context_service_update_visible(self, TRUE);
}

View File

@ -84,11 +84,11 @@ pub mod c {
}
let submission: &mut Submission = unsafe { &mut *submission };
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
} else {
Some(ui_manager)
}
})
};
}