Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-13 Thread Derek Foreman
On 08/10/15 03:00 PM, Daniel Stone wrote: > Hi, > > On 8 October 2015 at 08:27, Jonas Ådahl wrote: >> On Mon, Oct 05, 2015 at 12:04:49PM -0500, Derek Foreman wrote: >>> There are cases in weston where it would be quite nice to have a >>> sentinel value to use instead of having to have a bool for

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-13 Thread Bill Spitzak
On 10/13/2015 10:28 AM, Jasper St. Pierre wrote: In one case, an invalid serial dictates that the window should have it's focus attempts prevented. In the no-serial case, focus world be stolen. Yes, I have heard that. However I still find it hard to believe any compositor is going to be implem

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-13 Thread Jasper St. Pierre
In one case, an invalid serial dictates that the window should have it's focus attempts prevented. In the no-serial case, focus world be stolen. On Tue, Oct 13, 2015, 10:25 AM Bill Spitzak wrote: > On 10/13/2015 09:53 AM, Jasper St. Pierre wrote: > > The goal of focus-stealing prevention isn't t

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-13 Thread Bill Spitzak
On 10/13/2015 09:53 AM, Jasper St. Pierre wrote: The goal of focus-stealing prevention isn't to prevent hostile clients from stealing the focus. It's to allow friendly clients to upgrade the experience if they can track the originating event that originally opened a window. For instance, if I lau

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-13 Thread Jasper St. Pierre
The goal of focus-stealing prevention isn't to prevent hostile clients from stealing the focus. It's to allow friendly clients to upgrade the experience if they can track the originating event that originally opened a window. For instance, if I launch GIMP but then go back to typing in a terminal,

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-13 Thread Bill Spitzak
On 10/08/2015 01:00 PM, Daniel Stone wrote: Hi, On 8 October 2015 at 08:27, Jonas Ådahl wrote: On Mon, Oct 05, 2015 at 12:04:49PM -0500, Derek Foreman wrote: There are cases in weston where it would be quite nice to have a sentinel value to use instead of having to have a bool for "this seria

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-08 Thread Daniel Stone
Hi, On 8 October 2015 at 08:27, Jonas Ådahl wrote: > On Mon, Oct 05, 2015 at 12:04:49PM -0500, Derek Foreman wrote: >> There are cases in weston where it would be quite nice to have a >> sentinel value to use instead of having to have a bool for "this serial >> number is legit" too. > > Even thou

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-08 Thread Jonas Ådahl
On Mon, Oct 05, 2015 at 12:04:49PM -0500, Derek Foreman wrote: > On 30/09/15 03:23 PM, Jasper St. Pierre wrote: > > I don't necessarily like this. The absence of a serial can have > > radical meanings on behavior. Being able to pass 0 to mean "no serial" > > anywhere we currently rely on a serial s

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-05 Thread Derek Foreman
On 30/09/15 03:23 PM, Jasper St. Pierre wrote: > I don't necessarily like this. The absence of a serial can have > radical meanings on behavior. Being able to pass 0 to mean "no serial" > anywhere we currently rely on a serial seems like poor design to me, > and can easily be done by mistake. Eek,

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-05 Thread Derek Foreman
On 01/10/15 02:59 PM, Jasper St. Pierre wrote: > For the present case, present_with_event will support focus-stealing > prevention if the serial is garbage or not up to date, whereas present > should always steal focus. I thought the intent was that "present" would *never* steal focus, and that pr

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-01 Thread Bill Spitzak
On Thu, Oct 1, 2015 at 12:59 PM, Jasper St. Pierre wrote: > For the present case, present_with_event will support focus-stealing > prevention if the serial is garbage or not up to date, whereas present > should always steal focus. > > The garbage serial and don't-have-a-serial cases are different

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-01 Thread Jasper St. Pierre
For the present case, present_with_event will support focus-stealing prevention if the serial is garbage or not up to date, whereas present should always steal focus. The garbage serial and don't-have-a-serial cases are different, so I believe we should have two different methods in that case for

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-10-01 Thread Bill Spitzak
The no-serial value really really really needs to be zero. Otherwise you get all kinds of annoyances with many language wrappers which map zero to false and all other values to true. I think most will have to resort to xor'ing the value with the no-serial value, meaning the numerical values are all

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-09-30 Thread Jasper St. Pierre
I don't necessarily like this. The absence of a serial can have radical meanings on behavior. Being able to pass 0 to mean "no serial" anywhere we currently rely on a serial seems like poor design to me, and can easily be done by mistake. In cases where we have two behaviors for serial-aware and n

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-09-30 Thread Daniel Stone
Hi, On 30 September 2015 at 16:59, Derek Foreman wrote: > Having an invalid serial number is quite useful - for example, we can > have protocol requests that optionally take a serial number or 0 > instead of having two similar requests. > > Signed-off-by: Derek Foreman > --- > > Well, let's see

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-09-30 Thread Bill Spitzak
On Wed, Sep 30, 2015 at 9:45 AM, Derek Foreman wrote: > > So you're in favour of not bothering to give a helper function in > libwayland, and just expecting everyone to do their own thing? > I think so. Programmers want to know that it is a number, and not possibly some complex type that is expe

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-09-30 Thread Derek Foreman
On 30/09/15 11:37 AM, Bill Spitzak wrote: > > > On Wed, Sep 30, 2015 at 8:59 AM, Derek Foreman > wrote: > > Having an invalid serial number is quite useful - for example, we can > have protocol requests that optionally take a serial number or 0 > inste

Re: [PATCH wayland] server: Make serial number 0 mean invalid

2015-09-30 Thread Bill Spitzak
On Wed, Sep 30, 2015 at 8:59 AM, Derek Foreman wrote: > Having an invalid serial number is quite useful - for example, we can > have protocol requests that optionally take a serial number or 0 > instead of having two similar requests. > > Signed-off-by: Derek Foreman > --- > > Well, let's see wh

[PATCH wayland] server: Make serial number 0 mean invalid

2015-09-30 Thread Derek Foreman
Having an invalid serial number is quite useful - for example, we can have protocol requests that optionally take a serial number or 0 instead of having two similar requests. Signed-off-by: Derek Foreman --- Well, let's see where this goes ;) I've seen a few times now when having an invalid ser