Commit Graph
100 Commits
Author SHA1 Message Date
Guido Günther 0c4d3e5450 debian: Install translations 2021-12-05 18:14:39 +01:00
Guido Günther 3306907008 Revert "gresources: Drop popup.ui"
This reverts commit fdcef4aa88.
2021-12-04 13:12:48 +01:00
Guido Günther fdcef4aa88 gresources: Drop popup.ui
It's unused in the code atm
2021-12-03 19:00:22 +01:00
Guido Günther 74f55b30ef po: Add German translation 2021-12-03 18:59:52 +01:00
Guido Günther d696c9624e Reuse the unused popover ui file for i18n
Since the current code uses a handcoded approach for popup construction
reuse the unused ui file to keep translatable strings. Since UI file in
popover.rs runs through glib the strings get translated.

Future rework will allow us to get rid of this duplication but since the
ui file went unnoticed for so long who could possibly complain.

Closes: #315
2021-12-03 18:58:24 +01:00
Guido Günther 964f1da305 Initialize gettext 2021-12-03 18:58:12 +01:00
Guido Günther 73e7908709 langs: Don't use empty translation file
This breaks the translation

Closes: #313
2021-12-03 16:57:26 +01:00
Guido Günther 06b17907bf imservice: Invoke eekboard_context_service_set_hint_purpose unconditionally
Since eekboard_context_service_set_hint_purpose() checks if the
hint or purpose changed this doesn't cause unwanted layout reloads.

Closes: #311
2021-12-02 09:19:50 +01:00
Guido Günther 912fe0b7b7 entry: Add a random text entry field
This allows to test the case where the purpose changes but nothing else.
2021-12-02 09:19:50 +01:00
Guido Günther 937638c582 entry: Set a margin on the grids
Less heavy on the eyes.
2021-12-01 14:40:55 +01:00
Guido Günther 894191d3a0 entry: Use a scrolled window
This ensures all entries are reachable even with the OSK unfolded
2021-12-01 14:40:55 +01:00
Guido Günther 0d7fab2ef4 Honor input-purpose PIN
Otherwise e.g. SIM pins are requested with a numerical keyboard.
2021-11-30 13:29:11 +01:00
Guido Günther dd708456ff Move style-check to separate script
This avoids having to copy out of .gitlab-ci.yml before submitting an MR
to do a style check.

Could become a meson target at some point.
2021-11-23 18:16:36 +01:00
Guido Günther dce848b3ce README: Document SQUEEKBOARD_DEBUG environment variable 2021-11-23 12:46:16 +01:00
Guido Günther 03aa04d6d8 main: Add debug flag to show GTK inspector
Since squeekboard doesn't ever get input focus and hence we can't
activate it via keybinding add a debug flag.
2021-11-23 11:36:37 +01:00
Guido Günther 379a09e0d6 renderer: Disconnect theme change signal handler
The renderer does not stick around so we need to disconnect the signal
handler on "dispose". Since the renderer is not a GObject track the
signal id manually instead of using `g_signal_connect_object ()`.

Fixes 1995285 ("eek-renderer: Honor theme changes")
2021-11-22 17:56:15 +01:00
Guido Günther 1c875cda6c main: Add debug flag to always show squeekboard on start
This makes debugging way fun since there's no need to mess
with the running DBus, gsettings or anything else.
2021-11-22 17:10:43 +01:00
Guido Günther a6d766e650 renderer: Use g_debug ()
Switching to `g_debug ()` after adding `G_LOG_DOMAIN` got lost
in a rebase.
2021-11-22 17:08:17 +01:00
Guido Günther 74977ec88f gtk-keyboard: Don't set variable to NULL twice in a row 2021-11-22 17:08:15 +01:00
Guido Günther c3337b05b6 main: Use dark theme when run in a Phosh session
Downstreams either don't restyle making us divert from the designs or
use squeekboard-restyled adding extra complexity.

Closes: #242
2021-11-22 11:02:10 +01:00
Guido Günther 28a48635b3 main: Avoid two error variables in the same function
This also fixes a superfluous additional `NULL` assignment right
after declaring error and setting it to NULL.
2021-11-22 11:01:06 +01:00
Guido Günther 475761ec73 main: Drop broken support G_BUS_TYPE_SYSTEM
Fliping opt_system would still use opt_session so drop that.
While at that remove G_BUS_TYPE_NONE which can't be set by
an option either.
2021-11-22 11:01:06 +01:00
Guido Günther 1995285b65 eek-renderer: Honor theme changes
Reload style providers so e.g. switching to HighContrast is handled.

Closes: #296
2021-11-22 10:27:43 +01:00
Guido Günther 73515b5fe1 eek-renderer: Fix indentation 2021-11-22 10:27:43 +01:00
Guido Günther 8cfce093e7 eek-renderer: Add log domain
This allows to only log renderer messages similar to what
other projects to. `G_MESSAGES_DEBUG=all` is unaffected.
2021-11-22 10:27:43 +01:00
Guido Günther 359376041d main: Honor --help and -h
Use a GOptionContext to display command line options (that are already
handled by e.g. gtk_init anyway).

This turns:

  $ squeekboard -h
  Debug: Tried file "/home/agx/.local/share/squeekboard/keyboards/us.yaml", but it's missing: No such file or directory (os error 2)
  Info: Loaded layout Resource: us
  Debug: Tried file "/home/agx/.local/share/squeekboard/keyboards/us.yaml", but it's missing: No such file or directory (os error 2)
  Info: Loaded layout Resource: us

** (squeekboard:8015): WARNING **: 19:03:13.125: DBus unavailable, unclear how to continue. Is Squeekboard already running?

into the more useful

  $ squeekboard -h
  Usage:
    squeekboard [OPTION…] - A on screen keyboard

  Help Options:
    -h, --help               Show help options
    --help-all               Show all help options
    --help-gtk               Show GTK+ Options

  Application Options:
    --display=DISPLAY        X display to use

...
2021-11-21 20:45:58 +01:00
Guido Günther 6e1faafa2f main: Remove trailing whitespace 2021-11-21 20:37:51 +01:00
Guido Günther aa0e7d1c19 data: Fix build with meson 0.60.0
Drop the possitional argument since we otherwise see

  data/meson.build:15:5: ERROR: Function does not take positional arguments.
2021-11-06 11:13:07 +01:00
Guido Günther d629542ce2 Merge branch 'update-entry-py-filepath' into 'master'
Update entry.py file path in readme

See merge request World/Phosh/squeekboard!470
2021-08-11 07:08:38 +00:00
Guido Günther 39c004ecfc Merge branch 'ci' into 'master'
Fix gitlab CI

See merge request World/Phosh/squeekboard!471
2021-08-07 09:15:53 +00:00
Guido Günther 31f8e4e49f gitlab-ci: Drop build for outdated distributions 2021-08-07 10:56:39 +02:00
Guido Günther 2c662e0630 gitlab-ci: Adjust CI tags
This makes it build on GNOME infra
2021-08-07 10:54:27 +02:00
Guido Günther 40bf3ca5de server-main: Properly register to gnome-session
So far squeeboard only did half of the registration failing
to respond to the signals sent by the session.

This causes problems e.g. when exiting the session since the it
thinks the client hangs or is busy.

Closes: #274
2021-03-25 18:11:39 +01:00
Guido Günther e800a88893 server-main: Add quit()
This allows to exit the mainloop e.g. when signalled from gnome-session
or by a signal.
2021-03-25 16:03:57 +01:00
Guido Günther 4ccf11f4fd server-context-service: Don't show keyboard when disabled
If the corresponding a11y settings is disbaled don't unfold
the keyboad at all.

This helps e.g. running the same session on laptops or when
an external keyboard is attached.

Closes: #222
2020-09-14 11:34:17 +02:00
Guido Günther 8bdfb69dc1 server-context-service: swap signal arguments
This makes sure 'self' comes first. While at that fix the
function signatures and use ServerContextService directly
and add type checks so it's easy to notice when we messed up.
2020-09-11 20:44:36 +02:00
Guido Günther 1e6bcef055 server-context-service: Consistenty name self argument 'self'
It's confusing when the object a method acts on is sometimes called
context and sometimes called state. So name it 'self' as we do
in other projects.
2020-09-11 20:05:49 +02:00
Guido Günther 07faf906d8 eekboard-context-service: Drop private struct
There's no point having it for a final type and it only
makes the code harder to read.
2020-09-11 18:55:35 +02:00
Guido Günther 53f30324f0 eekboard-context-service: Drop the GObject boilerplate
The previous commits show it's not really a derivable type
so make it a finale one.
2020-09-11 18:55:35 +02:00
Guido Günther 3e212ddab4 eekboard-context-service: Drop docstrings for inexistent functions 2020-09-11 18:46:22 +02:00
Guido Günther 966990ad65 eekboad-context-service: Drop signal class handler
It's unused
2020-09-11 18:45:33 +02:00
Guido Günther a8b81172fc build: Enable '-Wformat-nonliteral' 2020-09-11 18:40:56 +02:00
Guido Günther 97f51591b3 ServerContextService: Drop GObject boilerplate
G_DECLARE_FINAL_TYPE does this for us
2020-09-11 18:16:30 +02:00
Guido Günther 6756fb423a build: Enable -Wredundant-declarations 2020-09-11 18:16:30 +02:00
Guido Günther eb7673d2c2 treewide: Drop redundant declarations 2020-09-11 18:16:30 +02:00
Guido Günther 24b6a04903 build: Enable -Wmaybe-uninitialized
No changes needed.
2020-09-11 18:16:30 +02:00
Guido Günther b197cd839e build: Enable -Wformat-security
No changes needed.
2020-09-11 18:16:30 +02:00
Guido Günther 857a916402 build: Enable -Winit-self
No changes needed
2020-09-11 18:16:30 +02:00
Guido Günther ca68fc2040 eek-keyboard: Don't ignore return value
This fixes

../eek/eek-keyboard.c:71:5: warning: ignoring return value of ‘getrandom’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   71 |     getrandom(r, 6, GRND_NONBLOCK);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[17/32] Compiling C object 'src/25a6634@@libsqueekboard@sta/.._eek_eek-renderer.c.o'
2020-09-11 18:16:30 +02:00
Guido Günther bd661bd4f4 gitlab-ci: Enable --Werror
This makes sure we don't have more warnings creeping in
2020-09-11 18:16:30 +02:00
Guido Günther 4228192bda layout: Fix warning
This fixes

warning: unnecessary parentheses around block return value
   --> /var/scratch/librem5/squeekboard/src/layout.rs:110:13
    |
110 | /             (point.x > self.x && point.x < self.x + self.width
111 | |                 && point.y > self.y && point.y < self.y + self.height)
    | |______________________________________________________________________^
    |
    = note: `#[warn(unused_parens)]` on by default
2020-09-11 18:16:30 +02:00
Guido Günther 0f7ab99da3 keyboard: Fix warning
warning: unused variable: `name`
   --> /var/scratch/librem5/squeekboard/src/keyboard.rs:195:10
    |
195 |     for (name, state) in keystates.iter() {
    |          ^^^^ help: consider prefixing with an underscore: `_name`
2020-09-11 18:16:30 +02:00
Guido Günther e15d317488 eekboard-context-service: Drop EEKBOARD_CONTEXT_SERVICE_GET_PRIVATE
This fixes the

../eekboard/eekboard-context-service.c:244:13: warning: Deprecated pre-processor symbol, replace with
  244 |     self->priv = EEKBOARD_CONTEXT_SERVICE_GET_PRIVATE(self);

warning and makes us use more modern GObject style
2020-09-11 18:16:30 +02:00
Guido Günther 93e9ce0dd7 build: Enable '-Wunused-function' 2020-09-11 18:16:13 +02:00
Guido Günther 9d63b505ec build: Enable '-Wold-style-definition' '-Wstrict-prototypes' 2020-09-11 18:15:44 +02:00
Guido Günther 306c11f1fd treewide: Use new style function definitions 2020-09-11 18:15:02 +02:00
Guido Günther c26feed8b2 eekboard-context-service: Return early if schema is unavailable
This also fixes a leak of GSettingsSchema.
2020-09-11 18:14:19 +02:00
Guido Günther ec58442724 eek-gtk-keyboard: Trigger event feedback on button press
Use libfeedback to trigger feedback for the button press event.

Closes: #166
2020-06-04 12:13:58 +02:00
Guido Günther e89c9b02a0 debian: Build-depend on libfeedback
Will be needed in the following commits.
2020-06-02 10:10:43 +02:00
Guido Günther 1b2725250b eek: Drop libcanberra usage 2020-06-02 10:10:43 +02:00
Guido Günther e285ecce93 d/rules: Only remove Cargo.lock if it exists
This allows to invoke the build target twice in a row
2020-06-02 10:10:43 +02:00
Guido Günther d816cc261a desktop file: Use NoDisplay=true
There's no point in having the keyboard in the list of installed
applications and it has no icon either.
2019-08-28 15:41:38 +02:00
Guido Günther 79dce7c4c3 gitlab-ci: Run tests under xvfb
We create widgets so need a display.
2019-07-23 10:20:07 +02:00
Guido Günther aff71e0e33 debian: Add test run dependencies
We need xvfb to run the tests since this involves creating GTK
widgets.
2019-07-23 10:20:02 +02:00
Guido Günther 633d69baca Drop HAVE_CLUTTER_GTK
We don't use it.
2019-07-17 19:50:53 +02:00
Guido Günther dbc8cc14bc Generate config.h
This allows us to remove a lot of #ifdef's. Either we want to use
a config.h or we don't. Since we'll want it for e.g. optional gsound
support later on let's have it.
2019-07-17 19:50:53 +02:00
Guido Günther c65583b911 Add a gitignore file
Based on the phosh one to ignore (upcoming) translations, editor
backup files and so forth.
2019-07-17 19:39:33 +02:00
Guido Günther 3d518b5757 build: Bump meson dep since we use '/' 2019-07-17 19:37:05 +02:00
Guido Günther 373713ba54 ServerContextService: Don't destroy widget all the time
This avoids icon theme lookups and lots of other stuff down the road.

Closes: #60
2019-07-17 17:16:35 +02:00
Guido Günther 068c325ee2 EekGtkRenderer: Use a hash table for icon theme lookups 2019-07-17 17:14:42 +02:00
Guido Günther 3b076e5e64 EekGtkRenderer: Simplify type declaration
It's 2019.
2019-07-17 17:14:42 +02:00
Guido Günther 07d6e3a0f2 ServerContextService: Don't use gtk_widget_show_all
This gives children more flexibility without using `no_show_all`.
2019-07-17 17:14:42 +02:00
Guido Günther 9974c385e5 EekboardContextService: Don't comment out property setters
This lets us keep the visible property up to date.
2019-07-17 00:44:09 +02:00
Guido Günther 8dafad80b1 ServerContextService: Check for mapped/unmapped
Visible does not tell us if the widget is actually visible on the
screen.
2019-07-17 00:44:00 +02:00
Guido Günther 93e9b2dde9 ServerContextService: Hide the widget instead of destroying it
This is quicker and makes sure we don't stack up surfaces.
2019-07-16 18:52:53 +02:00
Guido Günther c3a54595ea layersurface: Refresh layersurface on map
If the surface gets unmapped and mapped again we have another GDK window
so we have to reconfigure the layers surface on map and destroy it on
unmap.

This will be merged back into phosh if it works out.
2019-07-16 18:52:36 +02:00
Guido Günther 95ef52fe42 ServerContextService: Remove more unused code
The whole visible/enable logic was disfunctional all the time.
What works is show_keyboard and hide_keyboard.
2019-07-16 18:47:55 +02:00
Guido Günther c638c40a09 ServerContextService: Drop everything depending on self->was_visible
This was never used so everything depending on it was dead code.
2019-07-16 18:47:55 +02:00
Guido Günther 83d48d24ce ServerContextService: Really destroy the main window
Otherwise layer surfaces keep piling up
2019-07-16 18:47:55 +02:00
Guido Günther d807e43929 ServerContextService: Drop unneeded code
The layer shell code handles parts of this and others are just
not needed on wayland.
2019-07-16 18:47:55 +02:00
Guido Günther 0a112be956 ServerContextService: Show keyboard when everything else is set up
This avoids some flickering.
2019-07-16 18:47:55 +02:00
Guido Günther 078efa2a6e LayerShell: Set a proper namespace 2019-07-16 18:47:55 +02:00
Guido Günther 5827827008 Update layer surface code from phosh
As of commit 77bba4fcb2d836a58ccf8913d9a514aac6cc49a2. This allows
us to split the widget creation from making it visible.
2019-07-16 18:47:55 +02:00
Guido Günther cc00fcb5c9 Remove more files
autogen.sh is for automake and the TODO refers to eekboard.
2019-07-16 11:00:59 +02:00
Guido Günther 53f7a14717 EekboardService: Properly toggle keyboard visibility on DBus
Closes: #55
2019-07-16 10:21:59 +02:00
Guido Günther 94c9442de1 keyboard: Drop now unused clip_bounds_to_dirty_rectangle() 2019-07-15 17:42:32 +02:00
Guido Günther 8c044d0852 keyboard: Schedule widget redraw instead of gdk_window_invalidate_rect
The later would invaliate the drawn area again and again in a ::draw()
handler. This caused infinite redraws when e.g. a key was locked.  To
reproduce break e.g. on `eek_gtk_keyboard_real_draw()` and see how it is
invoked again and again.
2019-07-15 17:42:32 +02:00
Guido Günther 1f0cc0a5f3 keyboard: Don't leak on set_keyboard()
Unref and disconnect signals before setting a new keyboard.
2019-07-15 14:12:10 +02:00
Guido Günther 5693ce3df7 keyboard: Simplify signal disconnect
We're only keeping the signal ids around for disconnect but that only
happens in dispose so it's o.k.to just disconnect all keyboard signals
we listen to.
2019-07-15 14:12:10 +02:00
Guido Günther 086f6bd772 renderer: Only scale by output scale
The original eekboard code scaled icons by a factor. That was simplified
in c529e9ed9c but we can do away with it
completely and fetch the icons at the right size making them not blurry.
2019-07-15 13:23:16 +02:00
Guido Günther d0fa444a0e Honor the outputs scale factor 2019-07-15 13:13:34 +02:00
Guido Günther cd81aeb286 get_icon_surface: Add a scale argument
This will allow us to pass the output scale around
2019-07-15 13:13:34 +02:00
Guido Günther 7db33bc92e renderer: Add icons in resource bundle to the icon theme 2019-07-15 13:13:34 +02:00
Guido Günther fb6c501e44 renderer: Use gtk_icon_theme_load_surface
This will allow us to feed in the output scale.
2019-07-15 13:12:26 +02:00
Guido Günther ce7b398f7b LayerSurface: Make exclusive zone identical to height
Othewise we hide content beneath the keyboard.

Closes: #53
2019-07-15 12:49:11 +02:00
Guido Günther c529e9ed9c render: Simplify drawing
Instead of doing scale guessing we know that we get a properly
sized image from GTK+ so just scale it down a bit so it gets
some border within the drawing area.
2019-07-11 15:40:18 +02:00
Guido Günther d6a8a85b5e render: Get foreground color only once 2019-07-11 15:40:18 +02:00
Guido Günther 3a945535f7 render: Remove trailing white space 2019-07-11 15:40:18 +02:00
Guido Günther 0fc4374193 gtk-renderer: Simplify 2019-07-11 15:40:18 +02:00
Guido Günther 706a04dbfc gitlab-ci: No need for our ci repository
Just using debian buster makes things more stable.
2019-07-11 14:31:25 +02:00