Re: Wayland design principles (Re: wayland and gambas)

2024-04-30 Thread Thiago Macieira
On Monday 29 April 2024 22:23:44 GMT-7 Carsten Haitzler wrote:
> > There is worry in our community that Wayland is going to take over and x11
> > will become obsolete.
> 
> It's inevitable. We're just arguing on timescales (I think Wayland will need
> more time to mature but it'll get there).

I used to too, but I think we'll see X.org removed from non-LTS distros by the 
end of the decade. At a minimum, I don't see it being offered as a default for 
desktop distros; you'll need to install with Wayland and then later switch to 
X11.

> You might not be, but you may run some app you download from some random
> place on the internet you THINK is nice (some sodoku game trinket thing)
> but it's actually trying to steal your banking details... This is only
> getting worse in a world of snaps/flatpaks ...

And even if most people on this list don't do that, there are people who do. I 
refuse to run proprietary code as much as I can, and when I can't I want it to 
run as a separate user (thus non-graphical) with very strong system 
protections in the systemd .service file.

But I have several colleagues who download flatpaks and similars. Wayland has 
to be designed with that in mind.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Principal Engineer - Intel DCAI Cloud Engineering





Re: Wayland design principles (Re: wayland and gambas)

2024-04-30 Thread Carsten Haitzler
On Mon, 29 Apr 2024 22:38:10 +0100 Bruce Steers  said:

> On Mon, 29 Apr 2024, 20:53 Thiago Macieira,  wrote:
> 
> > On Monday 29 April 2024 10:05:32 GMT-7 Bruce Steers wrote:
> > > I guess/hope a similar thing will happen to x11 or Wayland will accept
> > this
> > > particular issue needs addressing and provide a workaround.
> > >
> > > As fundamentally Wayland principles are to us, restrictive in a way that
> > I
> > > think many will simply not tolerate.
> >
> > Please describe the need you have, not the means by which you think you
> > can
> > solve the need. For example, why do you think you need to specify absolute
> > positioning for certain windows?
> >
> 
> I personally have written many applications with gambas.
> 
> Some have no issue like my text editor for example, a standard looking
> editor with window and title bar.
> 
> Although gambas provides a Settings.Write(window_name) /
> Settings.Read(window_name) that saves/restores the window placement and
> size. It's bearable Wayland does not handle this.

YOU should never be handling this. It's like saying "I'm used to having to
hand-crank my car's motor for it to start... why can't I keep doing that?".

You should provide some unique naming for your windows. So they can't be
confused with other windows of yours or of other apps. Use the ame name each
time for that window. The rest is the compositor's job. It is in charge of
deciding to rememebr position, size, stacking, etc. etc. - and it likely will
do a drastically better job that 99% of apps. If all you do is the above,
you've barely scratched the surface of "remembering my window". Things you
don't handle above:

1. Stacking remembering (relative to other things you may know nothing about
like someoene else's windows)
2. What if screen geometry (resolution, aspect ratio/scaling etc.) changed
between the last time you ran and now? are you going to re-implement logic e.g.
to scale the position and size or choose an anchor closest (corners, centers
etc.) then position relative to those?
3. Collision avoidance - what if other windows of other apps all want to open up
in the same place and make a mess?
4. What about remembering the right screen to be on? What if monitors were
plugged/unplugged since last time?
 ...

You little logic above begins to become rather complex needing information it
doesn't even have and can't get. The point of Wayland is to move this into
where it belongs - the compositor, that has a view of everything and should get
this right in one place.

Ultimately your beef might be with your desktop/compositor of choice not
remembering for you or not doing it well (or perhaps naming on your part).

> Other applications I have made include a customizable LCD clock that runs
> at startup and places itself "where I want it"
> 
> And a program called Desktop-ish that shows .desktop file folders I can
> customize/add and has many features like customizable menus I have added
> many many things to that are very useful to me.
> 
> This also places itself "where I want it"

People have abused the ability to place custom windows (in X11 often
override-redirect) anywhere they like to adhoc do this over the years ...
err.. decades. I've done it. Many times. It's always led to a mess. You are
trying to create desktop gadgets and these often belong in sensible places.
The file manager that is an integral part of the desktop env  would need to
organize "desktop" layer gadgets along with file icons sensibly. You can't have
a free-for-all. Maybe the gadget should stick in some panel or menu bar? There
are better solutions for a lot of this - like "systray" (status notifier) and
probably need to be more of these specific solutions.

> My Linux is very personalized and works very well for my needs. (It's
> awesome 😎)

This hacking only goes so far before it hits a wall. I know. I've been there
and done that. Decades ago. You then eventually move on to realize your
solutions involve fixing the WM/compositor/desktop you work with and not "hack
around it". You may end up building your own.

> The same could probably be said for many gambas coders.
> 
> Now Wayland has come along and seems to be...
> "you can no longer control window placement, deal with it, why even want
> it?, we decided you don't need it"
> 😕

Correct. Decades of experience specifically in just this field has taught the
people designing this to not re-create the problems of the past just for the
sake of compatibility for some relatively niche things. For every feature you
think here is good, it leads to a much bigger problem space of badness and
decades of history has taught that lesson.

> It is unacceptable for the many who have customized their Linux world with
> their own work.
> 
> There is worry in our community that Wayland is going to take over and x11
> will become obsolete.

It's inevitable. We're just arguing on timescales (I think Wayland will need
more time to mature but it'll get there).

> And because nobody at Wa

Re: Wayland design principles (Re: wayland and gambas)

2024-04-30 Thread Pekka Paalanen
On Mon, 29 Apr 2024 22:38:10 +0100
Bruce Steers  wrote:

> 
> I personally have written many applications with gambas.
> 
> Some have no issue like my text editor for example, a standard looking
> editor with window and title bar.
> 
> Although gambas provides a Settings.Write(window_name) /
> Settings.Read(window_name) that saves/restores the window placement and
> size. It's bearable Wayland does not handle this.

There is a protocol extension in development for saving and restoring
window state:
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/18

Btw. many protocol extensions are harder to design for Wayland than for
X11, because Wayland needs to consider things like sandbox security.
People tend to try and run arbitrary applications from where-ever, and
it would be better if that can be done inside a secure sandbox (e.g.
flatpak packaged applications) that allows the application to do only
what it is expected to do. Roughly similar to like Android has
application permissions. Therefore Wayland features fundamental for most
applications cannot rely on things that could be considered security
holes.

> Other applications I have made include a customizable LCD clock that runs
> at startup and places itself "where I want it"
> 
> And a program called Desktop-ish that shows .desktop file folders I can
> customize/add and has many features like customizable menus I have added
> many many things to that are very useful to me.
> 
> This also places itself "where I want it"
> 
> My Linux is very personalized and works very well for my needs. (It's
> awesome 😎)

Where people want to build their own DE-alternative from individual
programs (DE components that are not regular apps), I believe they
turn to the wlr family of protocol extensions:
https://gitlab.freedesktop.org/wlroots/wlr-protocols

These are often found implemented in wlroots based compositors:
https://gitlab.freedesktop.org/wlroots/wlroots

e.g. https://swaywm.org/

> 
> The same could probably be said for many gambas coders.
> 
> Now Wayland has come along and seems to be...
> "you can no longer control window placement, deal with it, why even want
> it?, we decided you don't need it"
> 😕
> 
> It is unacceptable for the many who have customized their Linux world with
> their own work.

This is the difference between regular applications and DE components.
Regular applications have all the restrictions. On the other hand,
people do want to build DEs out of independent components, and that is
what the wlr protocol family has been designed for.

DE components are more or less privileged, because they are expected to
force things like their placement and always-on-top, or have access to
sensitive information like the list of all existing windows. They are
usually explicitly configured by the end user, conveying the end user
wishes that way. Hence the different set of protocols. Regular
applications are expected to not be able to do such things, so that a
random application cannot force its way against end user wishes on any
DE.

Highly integrated ready-made DEs may not want to support independent
DE components. Such DE projects may want to set up the desktop with
minimal end user effort, ensuring it always stays like the DE designers
intended. Running independent DE components would compromise that, and
the result would be even worse if all regular applications had the same
powers as DE components.

Every end user's choice begins with choosing the DE or a compositor. It
is up to them if they want a highly integrated designed by someone
else desktop environment, more freedom to configure things, or build
their own custom thing like from lego blocks. Or go really wild, and
create a new compositor project, perhaps based on some existing Wayland
compositor library to avoid years and years of secondary work.


Thanks,
pq


pgpG4HUtNoTEg.pgp
Description: OpenPGP digital signature


Re: Wayland design principles (Re: wayland and gambas)

2024-04-30 Thread Michel Dänzer
On 2024-04-29 23:38, Bruce Steers wrote:
> 
> There is worry in our community that Wayland is going to take over and x11 
> will become obsolete.

There's no need to worry about that. X clients will keep working in a Wayland 
session via Xwayland.


-- 
Earthling Michel Dänzer|  https://redhat.com
Libre software enthusiast  | Mesa and Xwayland developer