Commit Graph
74 Commits
Author SHA1 Message Date
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
Guido Günther 7fd51af4de debian: Drop virtboard build-dependency 2019-07-11 14:31:25 +02:00
Guido Günther c1af9b2ba4 Add dbus protocol definition
This let's us drop the virtboard build dependency.
2019-07-11 14:31:25 +02:00
Guido Günther b57e1ce660 Drop now unused theme_path 2019-07-10 15:39:16 +02:00
Guido Günther 7f5f310bf0 Add some border at the top
Closes: #28
2019-07-10 11:31:24 +02:00
Guido Günther f1d97e396b Drop icons
They're not being installed and we want ones matching current
GNOME design anyway.
2019-07-04 16:25:05 +02:00
Guido Günther abf8f4daa8 eek-theme: Remove code for old croko versions
These versions aren't even in Debian's oldstable release.
2019-07-04 16:21:18 +02:00
Guido Günther aba242301d Use a gresource to store the css
This makes build / test faster since one can skip install. It's
also more obvious which file is being used.
2019-07-04 16:16:04 +02:00
Guido Günther 7a52080940 Remove automake leftovers 2019-07-04 14:51:00 +02:00