Linux desktop manager Close Window is dangerous.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Linux desktop manager Close Window is dangerous.

Brad Fuller-2
Before I dig into this, I bet someone has already investigated this and
decided it can't be done. When you close the Squeak with the desktop
manager's "Close Window" (the "X"), squeak closes without a confirmation
dialog. Windows has an "Are you sure?" and I expect the Mac version does too.
Why not Linux?

(I'm running XFCE, but KDE and Gnome do the same thing.)

brad

Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Bert Freudenberg

On Aug 27, 2007, at 16:38 , Brad Fuller wrote:

> Before I dig into this, I bet someone has already investigated this  
> and
> decided it can't be done. When you close the Squeak with the desktop
> manager's "Close Window" (the "X"), squeak closes without a  
> confirmation
> dialog. Windows has an "Are you sure?" and I expect the Mac version  
> does too.
> Why not Linux?

It would add considerably to the complexity of the X11 VM - Xlib does  
not provide a dialog box call, whereas Win and Mac libraries do.

You could try to write it using Xlib calls, which would involve  
laying out text, drawing a button, having another event loop etc. No  
fun, besides you would get complains that it does not follow the  
user's desktop theme or native language. Or you could make the VM  
depend on GTK or KDE which we have avoided so far.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Brad Fuller-2
On Mon August 27 2007, Bert Freudenberg wrote:

> On Aug 27, 2007, at 16:38 , Brad Fuller wrote:
> > Before I dig into this, I bet someone has already investigated this
> > and
> > decided it can't be done. When you close the Squeak with the desktop
> > manager's "Close Window" (the "X"), squeak closes without a
> > confirmation
> > dialog. Windows has an "Are you sure?" and I expect the Mac version
> > does too.
> > Why not Linux?
>
> It would add considerably to the complexity of the X11 VM - Xlib does
> not provide a dialog box call, whereas Win and Mac libraries do.
>
> You could try to write it using Xlib calls, which would involve
> laying out text, drawing a button, having another event loop etc. No
> fun, besides you would get complains that it does not follow the
> user's desktop theme or native language.

Maybe, but it's better than closing w/o saving for the user, wouldn't it?

> Or you could make the VM
> depend on GTK or KDE which we have avoided so far.

what about "borrowing" firefox's confirmation dialog box on quit? It's
reasonable looking, and the work is already done -- not that it would take me
days to find it and then implement it ;-(  

brad

Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Michael van der Gulik-2
In reply to this post by Bert Freudenberg


On 8/28/07, Bert Freudenberg <[hidden email]> wrote:

On Aug 27, 2007, at 16:38 , Brad Fuller wrote:

> Before I dig into this, I bet someone has already investigated this
> and
> decided it can't be done. When you close the Squeak with the desktop
> manager's "Close Window" (the "X"), squeak closes without a
> confirmation
> dialog. Windows has an "Are you sure?" and I expect the Mac version
> does too.
> Why not Linux?

It would add considerably to the complexity of the X11 VM - Xlib does
not provide a dialog box call, whereas Win and Mac libraries do.

Would it be possible to send an event/message back to the VM so that the image could pop up a Morphic-based dialog box?

Michael.


Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Jason Johnson-5
In reply to this post by Bert Freudenberg
On 8/28/07, Bert Freudenberg <[hidden email]> wrote:

>
> It would add considerably to the complexity of the X11 VM - Xlib does
> not provide a dialog box call, whereas Win and Mac libraries do.
>
> You could try to write it using Xlib calls, which would involve
> laying out text, drawing a button, having another event loop etc. No
> fun, besides you would get complains that it does not follow the
> user's desktop theme or native language. Or you could make the VM
> depend on GTK or KDE which we have avoided so far.
>
> - Bert -

Couldn't you just use a dialog that already exists in Squeak?  Like
the one that pops up with you try to change a method that's been
modified since you started editing?

Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Hans-Martin Mosner
In reply to this post by Michael van der Gulik-2
Michael van der Gulik schrieb:
>
>
> Would it be possible to send an event/message back to the VM so that
> the image could pop up a Morphic-based dialog box?
That would be the best solution in my opinion.
The image could then decide what to do (default would be some dialog,
but some images might quietly store some state or write a snapshot and
quit).

Cheers,
Hans-Martin

Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Brad Fuller-2
In reply to this post by Michael van der Gulik-2
On Mon August 27 2007, Michael van der Gulik wrote:

> On 8/28/07, Bert Freudenberg <[hidden email]> wrote:
> > On Aug 27, 2007, at 16:38 , Brad Fuller wrote:
> > > Before I dig into this, I bet someone has already investigated this
> > > and
> > > decided it can't be done. When you close the Squeak with the desktop
> > > manager's "Close Window" (the "X"), squeak closes without a
> > > confirmation
> > > dialog. Windows has an "Are you sure?" and I expect the Mac version
> > > does too.
> > > Why not Linux?
> >
> > It would add considerably to the complexity of the X11 VM - Xlib does
> > not provide a dialog box call, whereas Win and Mac libraries do.
>
> Would it be possible to send an event/message back to the VM so that the
> image could pop up a Morphic-based dialog box?

Yeah, that would be the best because the experience would be (potentially)
more consistent across platforms. I've never written a Linux app, except
Squeak plugin - so I would have to figure out how to do it. It just seems we
should have a confirmation so a user doesn't accidentally hit the "X" when
s/he meant to hit the "Maximize" icon.

In fact, I'm now thinking this should be labelled a defect. What do you think?

brad.



Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Brian Brown-2

On Aug 28, 2007, at 8:43 AM, Brad Fuller wrote:

> On Mon August 27 2007, Michael van der Gulik wrote:
>> On 8/28/07, Bert Freudenberg <[hidden email]> wrote:
>>> On Aug 27, 2007, at 16:38 , Brad Fuller wrote:
>>>> Before I dig into this, I bet someone has already investigated this
>>>> and
>>>> decided it can't be done. When you close the Squeak with the  
>>>> desktop
>>>> manager's "Close Window" (the "X"), squeak closes without a
>>>> confirmation
>>>> dialog. Windows has an "Are you sure?" and I expect the Mac version
>>>> does too.
>>>> Why not Linux?
>>>
>>> It would add considerably to the complexity of the X11 VM - Xlib  
>>> does
>>> not provide a dialog box call, whereas Win and Mac libraries do.
>>
>> Would it be possible to send an event/message back to the VM so  
>> that the
>> image could pop up a Morphic-based dialog box?
>
> Yeah, that would be the best because the experience would be  
> (potentially)
> more consistent across platforms. I've never written a Linux app,  
> except
> Squeak plugin - so I would have to figure out how to do it. It just  
> seems we
> should have a confirmation so a user doesn't accidentally hit the  
> "X" when
> s/he meant to hit the "Maximize" icon.
>
> In fact, I'm now thinking this should be labelled a defect. What do  
> you think?
>

I *think* this issue with this is that Squeak has no visibility into  
those Window Manager functions. I hope I'm incorrect, but the window  
close message will happen and Squeak won't know about it.


- Brian


Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Brad Fuller-2
On Tue August 28 2007, Brian Brown wrote:

> On Aug 28, 2007, at 8:43 AM, Brad Fuller wrote:
> > On Mon August 27 2007, Michael van der Gulik wrote:
> >> On 8/28/07, Bert Freudenberg <[hidden email]> wrote:
> >>> On Aug 27, 2007, at 16:38 , Brad Fuller wrote:
> >>>> Before I dig into this, I bet someone has already investigated this
> >>>> and
> >>>> decided it can't be done. When you close the Squeak with the
> >>>> desktop
> >>>> manager's "Close Window" (the "X"), squeak closes without a
> >>>> confirmation
> >>>> dialog. Windows has an "Are you sure?" and I expect the Mac version
> >>>> does too.
> >>>> Why not Linux?
> >>>
> >>> It would add considerably to the complexity of the X11 VM - Xlib
> >>> does
> >>> not provide a dialog box call, whereas Win and Mac libraries do.
> >>
> >> Would it be possible to send an event/message back to the VM so
> >> that the
> >> image could pop up a Morphic-based dialog box?
> >
> > Yeah, that would be the best because the experience would be
> > (potentially)
> > more consistent across platforms. I've never written a Linux app,
> > except
> > Squeak plugin - so I would have to figure out how to do it. It just
> > seems we
> > should have a confirmation so a user doesn't accidentally hit the
> > "X" when
> > s/he meant to hit the "Maximize" icon.
> >
> > In fact, I'm now thinking this should be labelled a defect. What do
> > you think?
>
> I *think* this issue with this is that Squeak has no visibility into
> those Window Manager functions. I hope I'm incorrect, but the window
> close message will happen and Squeak won't know about it.

There are plenty of apps in Linux that will present a confirmation dialog when
the user clicks on the X icon. So, it can be done.

Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Michael van der Gulik-2
In reply to this post by Brian Brown-2


On 8/29/07, Brian Brown <[hidden email]> wrote:

On Aug 28, 2007, at 8:43 AM, Brad Fuller wrote:

> On Mon August 27 2007, Michael van der Gulik wrote:
>> On 8/28/07, Bert Freudenberg <[hidden email] > wrote:
>>> On Aug 27, 2007, at 16:38 , Brad Fuller wrote:
>>>> Before I dig into this, I bet someone has already investigated this
>>>> and
>>>> decided it can't be done. When you close the Squeak with the
>>>> desktop
>>>> manager's "Close Window" (the "X"), squeak closes without a
>>>> confirmation
>>>> dialog. Windows has an "Are you sure?" and I expect the Mac version
>>>> does too.
>>>> Why not Linux?
>>>
>>> It would add considerably to the complexity of the X11 VM - Xlib
>>> does
>>> not provide a dialog box call, whereas Win and Mac libraries do.
>>
>> Would it be possible to send an event/message back to the VM so
>> that the
>> image could pop up a Morphic-based dialog box?
>
> Yeah, that would be the best because the experience would be
> (potentially)
> more consistent across platforms. I've never written a Linux app,
> except
> Squeak plugin - so I would have to figure out how to do it. It just
> seems we
> should have a confirmation so a user doesn't accidentally hit the
> "X" when
> s/he meant to hit the "Maximize" icon.
>
> In fact, I'm now thinking this should be labelled a defect. What do
> you think?
If the user is likely to lose data, then yes.

I usually use Squeak full-screen, and IceWM asks me for confirmation anyway.
 

I *think* this issue with this is that Squeak has no visibility into
those Window Manager functions. I hope I'm incorrect, but the window
close message will happen and Squeak won't know about it.


It can be done...  see here:
http://www.tronche.com/gui/x/icccm/sec-4.html#s-4.2.8.1

Michael.


Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Brad Fuller-2
In reply to this post by Brad Fuller-2
On 8/29/07, Brian Brown <[hidden email]> wrote:

On Aug 28, 2007, at 8:43 AM, Brad Fuller wrote:
>
> In fact, I'm now thinking this should be labelled a defect. What do
> you think?

If the user is likely to lose data, then yes.

I usually use Squeak full-screen, and IceWM asks me for confirmation anyway.
 ==

Really? Wow, I don't remember KDE nor Gnome asking. Xfce4 certainly doesn't


Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Ian Piumarta-2
This patch disables the title bar quit button (iff your window  
manager participates in the WM_DELETE_WINDOW protocol) and causes an  
event of type 6 to be sent to the image (in response to which it  
should pop open the 'save changes before quit' dialogue -- an SEP).

If (1) several people report that this adequately addresses the issue  
and (2) nobody else has claimed event type 6, then I'll commit the  
changes and move the event type definition into sq.h next to the others.





quit.diff.gz (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Brad Fuller-2
On Wed August 29 2007, Ian Piumarta wrote:
> This patch disables the title bar quit button (iff your window
> manager participates in the WM_DELETE_WINDOW protocol) and causes an
> event of type 6 to be sent to the image (in response to which it
> should pop open the 'save changes before quit' dialogue -- an SEP).
>
> If (1) several people report that this adequately addresses the issue
> and (2) nobody else has claimed event type 6, then I'll commit the
> changes and move the event type definition into sq.h next to the others.

Wow... thanks Ian. And thanks for being consistent with the "quit"
confirmation within squeak (note my mantis entry for windows:
http://bugs.squeak.org/view.php?id=6643)

Unfortunately, I'll have to set SVN back up on this machine and build
(recently wiped and now using gentoo) to check it out. I have no ETA. But,
I'll do it as soon as I can. If others can check it out, please do.

thanks, again. Much obliged!

brad



Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Alexander Lazarevic'
In reply to this post by Ian Piumarta-2
I once tried to claim event types 6,7 and 8 (see [1]), but the plugin is
now irrelevant.

Alex

[1] http://bugs.squeak.org/view.php?id=893

Ian Piumarta schrieb:
> and (2) nobody else has claimed event type 6, then I'll commit the
> changes and move the event type definition into sq.h next to the others.

Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Bert Freudenberg
In reply to this post by Brad Fuller-2

On Aug 29, 2007, at 8:32 , Brad Fuller wrote:

> On Wed August 29 2007, Ian Piumarta wrote:
>> This patch disables the title bar quit button (iff your window
>> manager participates in the WM_DELETE_WINDOW protocol) and causes an
>> event of type 6 to be sent to the image (in response to which it
>> should pop open the 'save changes before quit' dialogue -- an SEP).
>>
>> If (1) several people report that this adequately addresses the issue
>> and (2) nobody else has claimed event type 6, then I'll commit the
>> changes and move the event type definition into sq.h next to the  
>> others.
>
> Wow... thanks Ian. And thanks for being consistent with the "quit"
> confirmation within squeak (note my mantis entry for windows:
> http://bugs.squeak.org/view.php?id=6643)
>
> Unfortunately, I'll have to set SVN back up on this machine and build
> (recently wiped and now using gentoo) to check it out. I have no  
> ETA. But,
> I'll do it as soon as I can. If others can check it out, please do.

I folded this into the OLPC VM branch (using event type 5 subtype 2  
as per sq.h):

http://squeakvm.org/cgi-bin/viewcvs.cgi/branches/olpc/platforms/unix/ 
vm-display-X11/sqUnixX11.c?rev=1753&r1=1737&r2=1753

The corresponsing image code is here:

http://tinlizzie.org/updates/etoys/updates/1574WindowEvents-JMM-bf.cs

"Change Set: WindowEvents-JMM-bf
Date: 30 August 2007
Author: John McIntosh, Bert Freudenberg

Add WindowEvent handling, based on JMM's Ffenestri-b-4-Events-Morphic.
1.cs. WindowEvents are dispatched to the World. The #windowClose  
event quits the image after showing a confirmation. This can be  
intercepted by setting a global windowEventHandler on the World."

John's original change set included support for multiple windows,  
this has been stripped out. Support for dispatching and handling  
WindowEvents has been added.

This is potentially useful for other platforms, provided they can be  
made into generating that close event. If they do not generate the  
event it should still be safe to have in the image.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Linux desktop manager Close Window is dangerous.

Lex Spoon-3
In reply to this post by Ian Piumarta-2
Ian Piumarta <[hidden email]> writes:
> This patch disables the title bar quit button (iff your window
> manager participates in the WM_DELETE_WINDOW protocol) and causes an
> event of type 6 to be sent to the image (in response to which it
> should pop open the 'save changes before quit' dialogue -- an SEP).
>
> If (1) several people report that this adequately addresses the issue
> and (2) nobody else has claimed event type 6, then I'll commit the
> changes and move the event type definition into sq.h next to the
> others.


Nice!  That will make Squeak play a lot nicer with the
window system.  -Lex