Working demos of Wayland application?

2023-10-05 Thread Fred vS
Hello.

I try to create Wayland applications with inspiration from demo-code.

I did lot of search in internet and finally found one site that gives +- 
working demos:
https://wayland-book.com

There are some code that must be updated (because obsolete) but all "steps" 
souce code are working.
Sadly the steps ended at chapter 10 and all the other chapters have "todo" as 
code.

Are there plans to continue the explanation with demo-code?

Does it exist somewhere a complete demo that can be compiled in 2023?
All the (very) few code I found did not compile.

Thanks.

Fre;D


RE: Problem with mmap keyboard.

2023-10-04 Thread Fred vS
Sorry for that double post.

It was already solved by Emmanuel.

Fre;D

De : wayland-devel  de la part de 
Fred vS 
Envoyé : mercredi 4 octobre 2023 20:14
À : wayland-devel@lists.freedesktop.org 
Objet : Problem with mmap keyboard.

Hello.


I try to make work the "Keyboard event" step from the Wayland-book but the C 
demo crash at loading.

The problem comes from the mapping: with that error:


Line 301: wl_keyboard_keymap: Assertion map_shm != MAP_FAILED' failed.


Here is the function:

static void
wl_keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
 uint32_t format, int32_t fd, uint32_t size)
{
 struct client_state *client_state = data;
 assert(format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1);

 // Line 301: Here problem with mapping
 char *map_shm = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
 assert(map_shm != MAP_FAILED);

 struct xkb_keymap *xkb_keymap = xkb_keymap_new_from_string(
 client_state->xkb_context, map_shm,
 XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
 munmap(map_shm, size);
 close(fd);

 struct xkb_state *xkb_state = xkb_state_new(xkb_keymap);
 xkb_keymap_unref(client_state->xkb_keymap);
 xkb_state_unref(client_state->xkb_state);
 client_state->xkb_keymap = xkb_keymap;
 client_state->xkb_state = xkb_state;
}



Why does the mapping fails, I did check fd and size and they are correctly 
assigned?


Thanks.



Problem with mmap keyboard.

2023-10-04 Thread Fred vS
Hello.


I try to make work the "Keyboard event" step from the Wayland-book but the C 
demo crash at loading.

The problem comes from the mapping: with that error:


Line 301: wl_keyboard_keymap: Assertion map_shm != MAP_FAILED' failed.


Here is the function:

static void
wl_keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
 uint32_t format, int32_t fd, uint32_t size)
{
 struct client_state *client_state = data;
 assert(format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1);

 // Line 301: Here problem with mapping
 char *map_shm = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
 assert(map_shm != MAP_FAILED);

 struct xkb_keymap *xkb_keymap = xkb_keymap_new_from_string(
 client_state->xkb_context, map_shm,
 XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
 munmap(map_shm, size);
 close(fd);

 struct xkb_state *xkb_state = xkb_state_new(xkb_keymap);
 xkb_keymap_unref(client_state->xkb_keymap);
 xkb_state_unref(client_state->xkb_state);
 client_state->xkb_keymap = xkb_keymap;
 client_state->xkb_state = xkb_state;
}



Why does the mapping fails, I did check fd and size and they are correctly 
assigned?


Thanks.



RE: Problem with mmap keyboard.

2023-10-04 Thread Fred vS
Hello!

>“From version 7 onwards, the fd must be mapped with MAP_PRIVATE by the
recipient, as MAP_SHARED may fail.”

Yep, it does the trick, well seen, now all the infos of the keyboard are 
working.

>I don’t know which wl_shell version you are using,

Huh, I did copy the source from:
https://wayland-book.com/seat/example.html

But I dont know where/who to advice to fix the code of wayland-book.

Anyway, many thanks Emmanuel for your precious eyes and advices.

I can continue now the Wayland exploration...

Fre;D


De : Fred vS 
Envoyé : mercredi 4 octobre 2023 20:44
À : wayland-devel@lists.freedesktop.org 
Objet : RE: Problem with mmap keyboard.

Ho, many thanks Emmanuel.

I will deeply study your mail.

By the way, I am busy to translate all the "steps" demos of the Wayland-book 
into Pascal:
https://github.com/fredvs/wayland-pascal

Now, Free Pascal compiler can create nice and working "Pure Wayland 
applications".
Note too that the C demos in Wayland-book have some ommisions in code ( I added 
the fixes in /src/c).
But for the "Keyboard events" step, I am blocked, the C "Keyboard events" demo 
in /src/c does not use the key-map, but it works to give the actions of the 
keys and the number of the keys. The same for the translated Pascal code.

But ok, I will try to make the map-keyboard working thanks to with your advices.

Many thanks.

Write you later.

Fre;D


De : Emmanuel Gil Peyrot 
Envoyé : mercredi 4 octobre 2023 20:28
À : Fred vS 
Cc : wayland-devel@lists.freedesktop.org 
Objet : Re: Problem with mmap keyboard.

On Wed, Oct 04, 2023 at 06:19:30PM +, Fred vS wrote:
> Hello.

Hi,

>
>
> I try to make work the "Keyboard event" step from the Wayland-book but the C 
> demo crash at loading.
>
> The problem comes from the mapping: with that error:
>
>
> Line 301: wl_keyboard_keymap: Assertion map_shm != MAP_FAILED' failed.
>
>
> Here is the function:
>
> static void
> wl_keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
>  uint32_t format, int32_t fd, uint32_t size)
> {
>  struct client_state *client_state = data;
>  assert(format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1);
>
>  // Line 301: Here problem with mapping
>  char *map_shm = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);

We can read in the documentation of this protocol:
https://wayland.app/protocols/wayland#wl_keyboard:event:keymap

“From version 7 onwards, the fd must be mapped with MAP_PRIVATE by the
recipient, as MAP_SHARED may fail.”

I don’t know which wl_shell version you are using, but check that maybe.

>  assert(map_shm != MAP_FAILED);
>
>  struct xkb_keymap *xkb_keymap = xkb_keymap_new_from_string(
>  client_state->xkb_context, map_shm,
>  XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
>  munmap(map_shm, size);
>  close(fd);
>
>  struct xkb_state *xkb_state = xkb_state_new(xkb_keymap);
>  xkb_keymap_unref(client_state->xkb_keymap);
>  xkb_state_unref(client_state->xkb_state);
>  client_state->xkb_keymap = xkb_keymap;
>  client_state->xkb_state = xkb_state;
> }
>
>
>
> Why does the mapping fails, I did check fd and size and they are correctly 
> assigned?
>
>
> Thanks.
>

--
Link Mauve


RE: Problem with mmap keyboard.

2023-10-04 Thread Fred vS
Ho, many thanks Emmanuel.

I will deeply study your mail.

By the way, I am busy to translate all the "steps" demos of the Wayland-book 
into Pascal:
https://github.com/fredvs/wayland-pascal

Now, Free Pascal compiler can create nice and working "Pure Wayland 
applications".
Note too that the C demos in Wayland-book have some ommisions in code ( I added 
the fixes in /src/c).
But for the "Keyboard events" step, I am blocked, the C "Keyboard events" demo 
in /src/c does not use the key-map, but it works to give the actions of the 
keys and the number of the keys. The same for the translated Pascal code.

But ok, I will try to make the map-keyboard working thanks to with your advices.

Many thanks.

Write you later.

Fre;D


De : Emmanuel Gil Peyrot 
Envoyé : mercredi 4 octobre 2023 20:28
À : Fred vS 
Cc : wayland-devel@lists.freedesktop.org 
Objet : Re: Problem with mmap keyboard.

On Wed, Oct 04, 2023 at 06:19:30PM +, Fred vS wrote:
> Hello.

Hi,

>
>
> I try to make work the "Keyboard event" step from the Wayland-book but the C 
> demo crash at loading.
>
> The problem comes from the mapping: with that error:
>
>
> Line 301: wl_keyboard_keymap: Assertion map_shm != MAP_FAILED' failed.
>
>
> Here is the function:
>
> static void
> wl_keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
>  uint32_t format, int32_t fd, uint32_t size)
> {
>  struct client_state *client_state = data;
>  assert(format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1);
>
>  // Line 301: Here problem with mapping
>  char *map_shm = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);

We can read in the documentation of this protocol:
https://wayland.app/protocols/wayland#wl_keyboard:event:keymap

“From version 7 onwards, the fd must be mapped with MAP_PRIVATE by the
recipient, as MAP_SHARED may fail.”

I don’t know which wl_shell version you are using, but check that maybe.

>  assert(map_shm != MAP_FAILED);
>
>  struct xkb_keymap *xkb_keymap = xkb_keymap_new_from_string(
>  client_state->xkb_context, map_shm,
>  XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
>  munmap(map_shm, size);
>  close(fd);
>
>  struct xkb_state *xkb_state = xkb_state_new(xkb_keymap);
>  xkb_keymap_unref(client_state->xkb_keymap);
>  xkb_state_unref(client_state->xkb_state);
>  client_state->xkb_keymap = xkb_keymap;
>  client_state->xkb_state = xkb_state;
> }
>
>
>
> Why does the mapping fails, I did check fd and size and they are correctly 
> assigned?
>
>
> Thanks.
>

--
Link Mauve


Problem with mmap keyboard.

2023-10-04 Thread Fred vS
Hello.


I try to make work the "Keyboard event" step from the Wayland-book but the C 
demo crash at loading.

The problem comes from the mapping: with that error:


Line 301: wl_keyboard_keymap: Assertion map_shm != MAP_FAILED' failed.


Here is the function:

static void
wl_keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
 uint32_t format, int32_t fd, uint32_t size)
{
 struct client_state *client_state = data;
 assert(format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1);

 // Line 301: Here problem with mapping
 char *map_shm = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
 assert(map_shm != MAP_FAILED);

 struct xkb_keymap *xkb_keymap = xkb_keymap_new_from_string(
 client_state->xkb_context, map_shm,
 XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
 munmap(map_shm, size);
 close(fd);

 struct xkb_state *xkb_state = xkb_state_new(xkb_keymap);
 xkb_keymap_unref(client_state->xkb_keymap);
 xkb_state_unref(client_state->xkb_state);
 client_state->xkb_keymap = xkb_keymap;
 client_state->xkb_state = xkb_state;
}



Why does the mapping fails, I did check fd and size and they are correctly 
assigned?


Thanks.



Re: More problems building xserver

2013-03-04 Thread Fred Ollinger
If you have the binary packages, this is obviously quicker, but I
found that the easiest thing to do is to google the name plus source
code and I usually found the source.

I stuff all the deps into /opt/wayland which wound up (for most
packages) to be quicker than tracking down the right vers of pre-build
binaries.

Fred

On Sun, Mar 3, 2013 at 10:08 PM, Bill Spitzak spit...@gmail.com wrote:
 With the newest version I am able to get wayland and weston to compile to
 working forms, but attempting to compile xserver fails.

 I am using a slightly modified version of this to compile:
  http://www.chaosreigns.com/wayland/buildscript/

 The script is attempting to build the xwayland-1.12 branch of
 git://anongit.freedesktop.org/xorg/xserver.

 xserver configure fails with this error:

 Requested 'xtrans = 1.2.7' but version of XTrans is 1.2.6
 No package 'xineramaproto' found

 I'm guessing that these two packages also need to be compiled, but have not
 had any luck in guessing the git repository names. It is also possible the
 wrong xserver branch is being used?

 This is not a huge deal but I did get the x server to work once, and it
 would be nice to test it against any window management experiements.
 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: Weston SDK

2013-02-15 Thread Fred Ollinger
Why not have an external api which does not change?

Surely there is functionality that plugin authors will want which will
not change?

I know that one objection is that there's the question of who is going
to maintain the glue b/w the external and internal. Perhaps we can
leave that to the plugin authors...

Sincrerely,

Fred

 Now, I don't want this to slow down what we can do with weston
 internals, so this won't be stable API across major releases for the
 forseeable future.  But for a stable branch we should be able to avoid
 breaking the plugin API.  For 1.0 for example, we haven't changed the
 API or ABI at all.

 Another caveat is that this doesn't imply that the exported API is
 particular useful or coherent.  I think what we have is fairly decent
 though, it's just that we never developed it with an eye to be an
 external, self-contained API.  So we may be exposing too little or too
 much or there may be broken or inconsitent stuff in there.  But I
 think the first step towards working this out is to try to expose the
 API and just be careful about not promising too much in
 terms of usefulness or stability initially.


 Thanks,
 pq
 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


qt5 waylnd support

2012-12-16 Thread Fred Ollinger
I have compiled wayland from git as well as qt5 under LFS 7.2 using
the instructions from LFS to get the dependencies installed (into
/opt/wayland) as well as the wayland and qt5 from git instructions
respectively.

I have a working weston system and I can run the demos for qt5, but
the menus do not work. The cursor (pointer) never changes from a stop
watch.

The applications are a mix of usable and not.

Here's some debug spew:

Qml debugging is enabled. Only use this in a safe environment!
Using Wayland-EGL
This plugin does not support propagateSizeHints()
This plugin does not support raise()
This plugin does not support raise()
This plugin does not support grabbing the keyboard
This plugin does not support raise()

Any ideas on how to get the last mile done, the menus working and so on.

Any info you need to help with this?

I'm willing to make changes on my system for better testing.

Sincerely,
Fred Ollinger
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Why does weston try to open .ini file 6 times?

2012-10-09 Thread Fred .
$ weston
Date: 2012-10-09 CEST
[20:11:27.906] weston 0.95.0
   http://wayland.freedesktop.org/
   Bug reports to:
https://bugs.freedesktop.org/enter_bug.cgi?product=weston
   Build:
[20:11:27.906] OS: Linux, 3.5.0-17-generic, #27-Ubuntu SMP Fri Oct 5
01:35:26 UTC 2012, x86_64
couldn't open /home/anonymous/.config/weston.ini
[20:11:27.906] Loading module '/usr/lib/weston/x11-backend.so'
couldn't open /home/anonymous/.config/weston.ini
[20:11:27.909] initializing x11 backend
couldn't open /home/anonymous/.config/weston.ini
libEGL warning: unsupported platform Windows
[20:11:27.946] XCB-XKB not available during build
[20:11:27.967] x11 output 1024x640, window id 75497477
[20:11:27.977] EGL version: 1.4 (DRI2)
[20:11:27.977] EGL vendor: Mesa Project
[20:11:27.977] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2
[20:11:27.977] EGL extensions: EGL_MESA_drm_image EGL_WL_bind_wayland_display
   EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_image
   EGL_KHR_gl_renderbuffer_image EGL_KHR_surfaceless_context
   EGL_KHR_create_context EGL_NOK_swap_region
   EGL_NOK_texture_from_pixmap EGL_NV_post_sub_buffer
[20:11:27.977] GL version: OpenGL ES 2.0 Mesa 9.0
[20:11:27.977] GLSL version: OpenGL ES GLSL ES 1.0.16
[20:11:27.977] GL vendor: nouveau
[20:11:27.977] GL renderer: Gallium 0.4 on NV84
[20:11:27.977] GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays
   GL_EXT_texture_filter_anisotropic
   GL_EXT_texture_compression_dxt1 GL_EXT_texture_format_BGRA
   GL_OES_depth24 GL_OES_element_index_uint
   GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8
   GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D
   GL_OES_texture_npot GL_OES_EGL_image GL_OES_depth_texture
   GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV
   GL_APPLE_texture_max_level GL_EXT_read_format_bgra
   GL_NV_fbo_color_attachments GL_OES_EGL_image_external
   GL_OES_vertex_array_object GL_EXT_texture_rg
   GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer
[20:11:28.014] Loading module '/usr/lib/weston/desktop-shell.so'
couldn't open /home/anonymous/.config/weston.ini
[20:11:28.016] libwayland: using socket /run/user/anonymous/wayland-0
[20:11:28.021] launching '/usr/lib/weston/weston-desktop-shell'
libEGL warning: unsupported platform Windows
couldn't open /home/anonymous/.config/weston.ini
couldn't open /home/anonymous/.config/weston.ini
[20:11:35.746] libwayland: disconnect from client 0x2382260
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: Gamma correct rendering with Wayland and Weston

2012-09-30 Thread Fred .
Can we have a tool like 'xgamma' now?

On Sun, Sep 30, 2012 at 4:10 PM, Kai-Uwe Behrmann k...@gmx.de wrote:
 In reply to John Kåre Alsaker Fri Sep 28 08:52:17 PDT 2012

 - srgb:
 Rendering in linear gamma:
 If the hardware supports sRGB textures:
 EGL: Use sRGB textures and present it as linear
 gamma to shaders.
 If the hardware doesn't support sRGB textures:
 Shader: Convert from sRGB to linear gamma.
 - rgb:
 Rendering in sRGB gamma:
 Shader: Convert from linear to sRGB gamma.


 sRGB textures implies supporting the sRGB colour space on textures.
 Is such a texture meant to tell the display system to do final colour
 conversion from sRGB to monitor colour space? Are non sRGB colour spaces
 still possible like CIE*XYZ or LStar-RGB.icc for sRGB textures?

 However you write only about gamma. That is confusing.
 sRGB is defined with colour primaries inside the CIE*XYZ space + gamma
 encoding, that is what you appear to be referring to, and exact viewing
 conditions [1]. Gamma is only one part of the sRGB standard. If you realy
 refere to just gamma, then your functions can not be standard compliant and
 logical you should avoid sRGB or make clear that you only refere to a subset
 of that standard. The term sRGB texture would be highly inappropriate for
 gamma encoding.

 Gamma, including the sRGB gamma flavor, belongs to a logical layer called
 gamma correction [2]. On the opposite, colour management needs proper
 knowledge of the used gamma, in order to work properly.

 kind regards
 Kai-Uwe Behrmann
 --
 developing for colour management www.behrmann.name + www.oyranos.org

 [1] http://en.wikipedia.org/wiki/SRGB
 [2] http://en.wikipedia.org/wiki/Gamma_correction

 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


$XDG_RUNTIME_DIR is now supported in Ubuntu 12.10 Quantal

2012-09-28 Thread Fred .
https://bugs.launchpad.net/ubuntu/+source/pam-xdg-support/+bug/894391

Steve Langasek (vorlon) wrote the package.
There was a FeatureFreeze Exception (FFe) and now it is in the repository.

$ sudo apt-get install libpam-xdg-support

Weston under X runs fine.
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Weston 0.95 is now in Ubuntu 12.10 repository

2012-09-11 Thread Fred .
http://packages.ubuntu.com/quantal/weston

Ubuntu now updated Weston from 0.85 to 0.95 in Ubuntu 12.10 Quantal.

I run it with nouveau.
- weston-terminal works.
- gtk stuff does not work.

I guess xwayland isn't compiled for nouveau, and/or gtk isn't compiled
with wayland backend.

$ weston-launch
weston-launch: Permission denied. You should either:
 - enable systemd session support for weston-launch.
 - or add yourself to the 'weston-launch' group.

Darxus weston-launch only works with the drm backend (not X).
Maybe the script should check if X is running?

[16:07:02.665] fatal: environment variable XDG_RUNTIME_DIR is not set.
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Weston should fallback if XDG_RUNTIME_DIR is not set as per the XDG specification

2012-09-11 Thread Fred .
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables

If $XDG_RUNTIME_DIR is not set applications should fall back to a
replacement directory with similar capabilities and print a warning
message.

Weston produces the following error message when XDG_RUNTIME_DIR is not set.
[21:43:53.365] fatal: environment variable XDG_RUNTIME_DIR is not set.
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel