Re: St.ButtonMask bug

2011-08-19 Thread Olav Vitters
On Fri, Aug 19, 2011 at 12:27:36PM +0200, Javier Domingo wrote:
 Did you mean
 
 5 = 16 ?

Oops.. yes.

-- 
Regards,
Olav
___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-shell-list


Re: St.ButtonMask bug

2011-08-19 Thread Antonio Hernández Díaz
El 19 de agosto de 2011 12:23, Olav Vitters o...@vitters.nl escribió:

 On Fri, Aug 19, 2011 at 12:19:10PM +0200, Antonio Hernández Díaz wrote:
  I'm writing a Shell extension and I have just found that the value for
  St.ButtonMask.THREE is 4. This is obviously wrong.
  Has anyone else noticed this problem?, Do you know if it has been
 corrected?

 It is a mask, so it is binary
 1 = 1   /  0001
 2 = 2   /  0010
 3 = 4   /  0100
 4 = 8   /  1000
 8 = 16  / 0001 

 etc
 --
 Regards,
 Olav



Yes, it is binary. The real problem comes when you try to handle a mouse
right click.

If you write a callback for a button-press-event signal and try to get the
pressed button,
for a right click you get event.get_button() == 3, and there isn't a mask
with that value.

I don't know what's the expected behaviour, but the values are:

  get_button()   |   ButtonMask
left click 1   1
middle click2   2
right click   3   4


Do I have to write a comparison like event.get_button() == St.ButtonMask.ONE
| St.ButtonMask.TWO or something?
Isn't it easier to have a mask for each of the mouse buttons?

-- 
Antonio Hernández
___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-shell-list


Re: St.ButtonMask bug

2011-08-19 Thread Emmanuele Bassi
On 2011-08-19 at 13:11, Antonio Hernández Díaz wrote:
 Yes, it is binary. The real problem comes when you try to handle a mouse
 right click.
 
 If you write a callback for a button-press-event signal and try to get the
 pressed button,
 for a right click you get event.get_button() == 3, and there isn't a mask
 with that value.

you don't use masks for that.

button identifiers are numeric (it's a trait shared between X11, GDK and
Clutter) because the pointer device can have a non-standard layout, can
be user-rearranged, or can be left or right oriented.

 I don't know what's the expected behaviour, but the values are:
 
   get_button()   |   ButtonMask
 left click 1   1
 middle click2   2
 right click   3   4

the first column should really be:

  primary
  middle
  secondary

where primary is usually the left-most button in a right-handed layout,
and secondary is the right-most button in the same layout.

 Do I have to write a comparison like event.get_button()

just use the numeric id, as you did above:

  if (event.get_button() == 1) {
  ...
  }

ciao,
 Emmanuele.

W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi
___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-shell-list


Re: Experience feedback

2011-08-19 Thread Federico Mena Quintero
On Thu, 2011-08-18 at 22:07 +0200, Olav Vitters wrote:
 On Thu, Aug 18, 2011 at 09:47:26PM +0200, Rovanion Luckey wrote:
  It already works, there is no dark magic behind having a visible Power Off
  button. The Gnome Shell UI however seems to wish it could communicate that
  the user has to press down Alt before the Power Off button becomes visible
  via magic.
 
 This was already explained, I am not going to repeat.

This needs to go in the FAQ, with a pointer to the rationale behind the
decision.  Would you mind adding it?

As far as I can tell, this is not answered in either of these:
https://live.gnome.org/GnomeShell/FAQ
https://live.gnome.org/GnomeShell/Design/FAQ

And this page says *what* happens (and how to access the power off
option), but not *why*:
https://live.gnome.org/GnomeShell/Design/Whiteboards/SystemStopRestart

In the Comments section of that page, Sri and others ask the same
question, but it is not answered there yet.

  Federico

___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-shell-list


Re: Experience feedback

2011-08-19 Thread Denis Washington

Am 19.08.2011 16:28, schrieb Federico Mena Quintero:

On Thu, 2011-08-18 at 22:07 +0200, Olav Vitters wrote:

On Thu, Aug 18, 2011 at 09:47:26PM +0200, Rovanion Luckey wrote:

It already works, there is no dark magic behind having a visible Power Off
button. The Gnome Shell UI however seems to wish it could communicate that
the user has to press down Alt before the Power Off button becomes visible
via magic.


This was already explained, I am not going to repeat.


This needs to go in the FAQ, with a pointer to the rationale behind the
decision.  Would you mind adding it?

As far as I can tell, this is not answered in either of these:
https://live.gnome.org/GnomeShell/FAQ
https://live.gnome.org/GnomeShell/Design/FAQ

And this page says *what* happens (and how to access the power off
option), but not *why*:
https://live.gnome.org/GnomeShell/Design/Whiteboards/SystemStopRestart

In the Comments section of that page, Sri and others ask the same
question, but it is not answered there yet.


If such a rationale is added, I would be especially interested in how 
the environmental concerns are adressed - given that for situations such 
as turning a computer off over night, suspending takes much more power 
in the long term.


Regards,
Denis

___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-shell-list