Commit Graph

128 Commits

Author SHA1 Message Date
Christian Hergert
93e2e70c7b dmabuf-paintable: remove use of arc box
There is only a single unref of this, via the GdkGLTexture so just use a
free function and g_new0()/g_free().
2023-06-02 10:23:31 -07:00
Christian Hergert
a2525530ec screen: remove mks-screen-private.h
It wasn't doing anything for us, so just remove it.
2023-06-02 10:22:27 -07:00
Christian Hergert
58d99fb8b1 dmabuf-paintable: code style cleanup 2023-06-02 10:19:37 -07:00
Christian Hergert
0d43432bfa janitorial: code style and formatting cleanup 2023-06-02 10:18:54 -07:00
Christian Hergert
43dda37c79 license: update sources to LGPLv2.1+
See merge request !25
2023-06-02 10:18:05 -07:00
Bilal Elmoussaoui
7c67084055 Relicense as LGPLv2.1+ 2023-06-01 12:04:35 +01:00
Bilal Elmoussaoui
b23bdcffd7 In certain cases, you might want to control the VM size when running
QEMU instead of having libmks handling that when resizing the widget

This also would allow having an option for auto-scaling that would
scale the texture to fit the widget size
2023-05-31 20:13:06 +01:00
Christian Hergert
6d6c470288 Merge branch 'set-lib-soname' into 'main'
build: Set a SONAME version in the libmks library

See merge request chergert/libmks!23
2023-05-31 16:46:58 +00:00
Bilal Elmoussaoui
fc996f251b build: Don't include Speaker type
Currently, the Speaker device is not fully implemented. So let us stop
building those files to avoid exposing them as part of the docs/gir API
until someone finishes it implementation

Part of #6
2023-05-30 11:16:01 +01:00
Javier Martinez Canillas
868aad0244
build: Set a SONAME version in the libmks library
The libmks library is currently unversioned, but donwstream users expect
this library to have a proper SONAME version in order to package them.

A stable release has not yet happened because the project is still under
development and the API/ABI might change. But having a versioned SONAME
would allow distributions to package libmks, without the need to add any
downstream patch to set the library version.

Since the "0.1.0" version is already set as the meson project, let's use
it to set the library version as well. The meson build system will use the
first part of the version (0) as the SONAME version, which is aligned with
the convention used by other projects:

  $ ls ./lib/libmks-1.so* -1
  ./lib/libmks-1.so
  ./lib/libmks-1.so.0
  ./lib/libmks-1.so.0.1.0

  $ objdump -p ./lib/libmks-1.so.0.1.0 | grep SONAME
  SONAME               libmks-1.so.0
2023-05-30 11:46:27 +02:00
Christian Hergert
543c0cbbda Merge branch 'aesteve/fix-atomic-kms-cursor' into 'main'
display-picture: set cursor on init

See merge request chergert/libmks!19
2023-05-26 04:51:34 +00:00
Albert Esteve
25b58fc0a2 display-picture: set cursor on init
Set cursor to none (i.e., hide it) on init.
Otherwise, in cases where the define_cursor
signal is not received (e.g., atomic kms),
there are two cursors painted on the Widget
display.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
2023-05-25 10:19:17 +02:00
Bilal Elmoussaoui
6b29de7164 Drop duplicated create_socketpair 2023-05-25 09:59:45 +02:00
Bilal Elmoussaoui
5736f4e19f paintable: Properly close DMABuf FD
As g_unix_fd_list_get will dup the FD, we must close it once we are done
with it.
The issue went unnoticable during my testing as apprently, the max
number of open FDs is not in sync between host & toolbox and that is
annoying podman issue...
2023-05-24 15:17:46 +02:00
Bilal Elmoussaoui
c7772df9aa docs: Document most of the public APIs 2023-05-23 12:34:01 +02:00
Christian Hergert
c0f0d1c22c build: fix include directories for subprojects
We have no need to include the top-level when depended on, as config.h
will only ever be used by our internal .c files.

Related !17
2023-05-17 14:35:56 -07:00
Christian Hergert
f71a2002ba display-picture: use compute_point()
The gtk_widget_translate_coordinates() API is now deprecated, so use the
compute_point() API and ensure that we can translate to the target widget.
2023-05-17 13:53:49 -07:00
Christian Hergert
4be889b608 display-picture: remove deprecated allocation API usage 2023-05-17 13:48:21 -07:00
Christian Hergert
cae805a728 resizer: only branch when non-NULL
My previous commit broke this, which is needed because we always return
FALSE when either are NULL.
2023-05-17 13:37:33 -07:00
Christian Hergert
69dfaddb9d resizer: various code-style cleanup
Related !13
2023-05-17 13:36:11 -07:00
Christian Hergert
6a024f0e5d Merge branch 'bilelmoussaoui/reconfigure' into 'main'
display: Reconfigure screen when size change

See merge request chergert/libmks!13
2023-05-17 20:11:49 +00:00
Bilal Elmoussaoui
c259212be5 dmabuf: Properly propagate damage area
The current approach makes use of
- A tiled rendering to work around gdk_texture_diff only doing pointer
comparaison
- Assumes that we would only recieve a scanout cmd followed by multiple
flush ones

In reality, with virtio-gpu at least, the scanout cmd is always
submitted followed by a flush one containing the damaged region.

With the assumption currently made, we end up creating a new paintable
for every scanout cmd causing a full redraw instead
of only redrawing the damaged areas.
Isntead we create the paintable once and call import whenever
we receive a flush cmd (UpdateDMABUF) so we can properly
pass the damage area when creating a GdkGLTexture making
the tiled rendering no longer needed.
2023-05-17 13:08:37 -07:00
Bilal Elmoussaoui
51f8615099 build: Set the pkg-config name when generating GIR
Should help gi-docgen figure out the pkg-config name to display in the
docs
2023-05-14 19:03:01 +02:00
Bilal Elmoussaoui
2636c9e1a9 build: Various fixes to auto generated sources
Needed to fix the build when GTK is also built from a subproject
2023-05-14 19:03:01 +02:00
Bilal Elmoussaoui
a804f766f9 display: Reconfigure screen when size change
Otherwise the VM would have no idea about the size of the target widget.
To do so, we introduce a ScreenResizer object that remembers the previous
screen attributes as well the next attributes to configure.
Taking care of scheduling resize operations and avoids submitting
the same attributes twice.
2023-05-10 00:32:35 +02:00
Christian Hergert
cd7825d9d5 build: allow -Dtracing for more logging information 2023-04-20 14:00:04 -07:00
Christian Hergert
15e6667292 Merge branch 'add-vala-support' into 'main'
Add VAPI (vala) support

See merge request chergert/libmks!11
2023-04-20 20:46:21 +00:00
Felipe Borges
14c368d9e7 Add VAPI (vala) support 2023-04-17 12:46:26 +02:00
Bilal Elmoussaoui
26f4b72708 display-picture: Don't compute min-width/min-height
They are not useful for us as we would like the user to be able to
shrink the picture.
It is a leftover of migrating from GtkPicture
2023-04-13 15:13:27 +02:00
Bilal Elmoussaoui
b4fade7fe1 cleanup: Drop useless conditions 2023-04-13 15:04:40 +02:00
Christian Hergert
188c63a183 Merge branch 'bilelmoussaoui/fix-focus' into 'main'
display: Grab focus on MksDisplayPicture

See merge request chergert/libmks!8
2023-04-04 03:28:32 +00:00
Christian Hergert
02edb73d2a Merge branch 'bilelmoussaoui/expose-translate-keycode' into 'main'
keyboard: Expose keycode translation helper

See merge request chergert/libmks!7
2023-04-04 03:26:14 +00:00
Christian Hergert
5d1f5818c9 Merge branch 'bilelmoussaoui-main-patch-70944' into 'main'
display-picture: Fix keyval value

See merge request chergert/libmks!6
2023-04-04 03:23:29 +00:00
Christian Hergert
8e7702012a Merge branch 'bilelmoussaoui/fix-session-ctor' into 'main'
session: Fix the display dbus path

See merge request chergert/libmks!5
2023-04-04 03:23:13 +00:00
Bilal Elmoussaoui
5783b6a8ce display: Grab focus on MksDisplayPicture 2023-04-03 22:17:31 +02:00
Bilal Elmoussaoui
57370d5a73 keyboard: Expose keycode translation helper
Useful for exposing keyboard shortcuts triggers on the UI
Similar to what Boxes does for Ctrl+Shift+F
2023-04-03 17:33:11 +02:00
Bilal Elmoussaoui
df42bbb20e display-picture: Fix keyval value 2023-04-03 13:31:33 +00:00
Bilal Elmoussaoui
266f1ae834 session: Fix the display dbus path
As that is what implements the ObjectManager interface
2023-03-31 10:57:10 +02:00
Bilal Elmoussaoui
c7ba1c0104 build: Add an option to disable introspection 2023-03-30 13:15:00 +02:00
Bilal Elmoussaoui
89d37ada0d lib: Add missing headers & fix enums install dir 2023-03-29 13:09:33 +02:00
Christian Hergert
1d68a4d8f4 lib: wire up various signal handlers for audio out listener 2023-03-02 20:38:30 -08:00
Christian Hergert
378c9614ed lib: use source for cairo fill operator 2023-03-02 17:55:30 -08:00
Christian Hergert
088e1b5ce4 keyboard: add tracing macros 2023-02-28 18:57:17 -08:00
Christian Hergert
b3a0a4028c lib: add tracing for MksMouse 2023-02-28 12:49:37 -08:00
Christian Hergert
edd88dcec3 util: add simple tracing macros 2023-02-27 20:23:25 -08:00
Christian Hergert
e4d089fb52 util: fix typo 2023-02-27 20:16:17 -08:00
Christian Hergert
1d51bffe8f lib: implement basics for audio out stream 2023-02-27 18:44:42 -08:00
Christian Hergert
ec60165c70 lib: ensure UnixFDList availability for AudioIn/Out 2023-02-27 18:43:39 -08:00
Christian Hergert
98032981cd util: add socketpair GDBusConnection helper 2023-02-26 10:57:50 -08:00
Christian Hergert
294e01836d speaker: add autoptr cleanup func 2023-02-26 10:57:33 -08:00