Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4049e66307 | |||
| 046a516a11 | |||
| b5d1e8c3eb | |||
| aee296ad96 | |||
| 5f59db478a | |||
| dda070e84e | |||
| ebbb3b1138 | |||
| 277986bcdf | |||
| 96461cf2aa | |||
| 2029f48b4d | |||
| 943d2de536 |
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -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"
|
||||
|
||||
@ -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:
|
||||
- "~ ` ´ | · √ µ ÷ × ¶"
|
||||
|
||||
@ -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
13
debian/changelog
vendored
@ -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 ]
|
||||
|
||||
@ -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?
|
||||
@ -377,7 +372,27 @@ 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 => {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user