After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 79500 - Clicking a task in window list a second time to minimize
Clicking a task in window list a second time to minimize
Status: VERIFIED FIXED
Product: libwnck
Classification: Core
Component: general
unspecified
Other other
: High minor
: ---
Assigned To: libwnck maintainers
libwnck maintainers
: 4379 82496 85366 86574 87792 90019 90339 (view as bug list)
Depends on:
Blocks: 85302
 
 
Reported: 2002-04-22 13:28 UTC by Dan Siemon
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch fixes the min/restore on single click. (2.30 KB, patch)
2002-07-31 15:21 UTC, Arvind S N
none Details | Review
Another attempt to nail this bug (4.29 KB, patch)
2002-08-06 16:37 UTC, Arvind S N
none Details | Review
Patch as per seth's suggestion. (1.24 KB, patch)
2002-08-10 14:14 UTC, Arvind S N
none Details | Review

Description Dan Siemon 2002-04-22 13:28:15 UTC
Package: gnome-panel
Severity: enhancement
Version: CVS 2002-04-20
Synopsis: Clicking on a window in the window list does not iconify it.
Bugzilla-Product: gnome-panel
Bugzilla-Component: Window List Applet

Description:
With the GNOME 1.x tasklist if you clicked on a task that was focused it
would iconify it. The new Window List does not have this feature.




------- Bug moved to this database by unknown@bugzilla.gnome.org 2002-04-22 09:28 -------

Reassigning to the default owner of the component, gnome-panel-maint@bugzilla.gnome.org.

Comment 1 martin H. 2002-05-01 19:19:08 UTC
I think this really good. I think the 1.4 behviour is really 
annoying, but that might also be because in 1.4 it often got wrong 
which application is the "active"(user perspective) at the moment. 
On the otherhand this  1.4 problem seems hard to fix, because the 
topmost window isn't nesseceryly the focused one (alway on top 
windows, push windows to back, unusual but really helpful (for 
certain task) sawfish options).

I think it is more consistent without this feature(iconify a focused 
task by clicking it) (Havoc and Co won't approve a option for it 
would they...).

Anyway this overloads the left-single-click on the button with 2 
contrasting options and is not quite the least surprise 
behaviour(expect for ppl coming from win98 and above).
Comment 2 Aschwin van der Woude 2002-05-09 09:24:45 UTC
I am missing this feature too, in gnome 1.4 I used it a lot.
Mostly with moving a window to another workspace.

I used this sequence :

- Iconify window by clicking on it in the window-list (or was it a
double clink??)
- Click on another workspace in pager (which is near to the window-list)
- click on the task again to drop it onto the workspace

This sequence doesn't work under gnome2 for two reasons:

- The reason as desribed in this bug-report
- Iconified windows aren't shown in other workspaces (I will file a
bug for this)

So in my opinion this feature should return in gnome2, it is very
unobtrusive and doesn't cause any confusion.(Especially with the
iconify animation used by Metacity) Therefore I see no reason to leave
this feature out.
Comment 3 Aschwin van der Woude 2002-05-09 09:34:34 UTC
Bug #81222 describes the second reason of the above comment.
Comment 4 martin H. 2002-05-09 11:28:52 UTC
I still think that this feature is on crack, at least if bound to 
single-left click. If it would reappear on double-left click it ok, 
but *please* don't do this on single-left click. I hated windows for 
it('95 got it right).

BTW moving windows to other workspaces could be a nice and easy 
operation, not a trickery with iconize, switch, restore. I have 
installed a nice sawfish addon that just gives me that option in the 
menu of the windows. And a keyboard binding is availible for this 
too (even in stock sawfish).
KDE has a submenu in it's tasklist to send windows to different 
workspaces, this is much more intuitiv than any tricks.
Comment 5 Aschwin van der Woude 2002-05-09 14:30:23 UTC
A double-click would be fine with me.

Metacity has option to move it to another workspace too in its
window-menu. 
But for me this is too cumbersom, although I probably will get used it
when no better (IMO) is possible.
Comment 6 Luis Villa 2002-05-13 18:15:26 UTC
AFAICT, in latest builds [when using metacity], this /is/ bound to
double-click. Can someone else confirm please?
Comment 7 Aschwin van der Woude 2002-05-13 20:20:24 UTC
I found that out too last weekend, but somehow it isn't consistent.

Somehow it sometime works on a double click, sometime I have to hold
the button on the second click. Sometimes I don't get it triggered at all.

I tried it many times in a row to figure it out, but it seems to work
inconsistently. 
I don't know if it the timing of the double click is too critical or
something similar.
Comment 8 martin H. 2002-05-13 23:09:34 UTC
Hmm, now this is strange, just tested it today again, and now it 
seems that now it minimizes active windows on normal click (single 
left).

I dug into the code to see what's up.
from libwnck/libwnck/tasklist.c line 1341:
        if (wnck_window_is_active (task->window))
        {
          wnck_window_minimize (task->window);
          return;
        }
This code snippet in wnck_tasklist_activate_task_window iconifies 
the active window if it is actived again. Otherwise it activates the 
window.

But this code hasn't changed since rev 1.10 (dec 2001). I don't know 
why it didn't work but now does.

I scaned the mailing list archives:
http://mail.gnome.org/archives/gnome-list/2000-June/msg00848.html
may give some hints about this problem.

But just again, I think this behavior is broken, it sould be at 
least double click to minimize the window. Now that i know the pice 
of code that does this. I'll patch my local version...

If somebody is interested in making this work only on double click i 
maybe make a patch...

BTW, this got in without a ChangeLog entry describing, no mailing 
list discussion.
Maybe i should post about this to the usability list.
Comment 9 Aschwin van der Woude 2002-05-14 06:23:26 UTC
I found the same piece of code, and it seemed ok to me. But the
behaviour ain't working right. It doesn't work on a single click. 
This should be a double click off course.
I dug some further but sofar I don't have a clear picture of the
code-paths involved, and where the problem might come from.

I did notice the focus changes when I click on the active task in the
list. The focus is given to the panel.
I am not sure if this is the cause, but it could be a hint.
Comment 10 Luis Villa 2002-05-21 19:54:48 UTC
*** Bug 82496 has been marked as a duplicate of this bug. ***
Comment 11 Luis Villa 2002-05-21 19:57:52 UTC
From the duplicate:
NOTE: On gnome1.4 the behaviour was as follows:

(1) To maximise a minimised app user just had to do a simple single click
on the app in the window list applet.

(2) To minimise a maximised app user just had to do a simple double click
on the app in the window list.
Comment 12 Dave Bordoley [Not Reading Bug Mail] 2002-06-14 14:46:08 UTC
there is a related metacity bug. bug 4379 
Comment 13 Luis Villa 2002-06-17 05:30:38 UTC
*** Bug 85366 has been marked as a duplicate of this bug. ***
Comment 14 Aschwin van der Woude 2002-06-17 06:38:16 UTC
The simple double-click seems hard to trigger, I need to have a very
fast double-click to get the effect. 
But somehow the window uniconizes right away again.
I tested this with the latest garnome release (0.11.0)
Comment 15 Luis Villa 2002-06-19 04:19:14 UTC
Havoc: it appears from the feedback that this clearly isn't window
list; looks like libwnck or the WM. Can you please pick one? :) 
Comment 16 martin H. 2002-06-19 20:41:45 UTC
libwnck would be my guess. The window list applet is just a thin 
wrapper arounda libwnck widget. I tacked the problem down to the 
conditions wnck_tasklist_activate_task_window is called (libwnck: 
tasklist.c). But I don't have time at the moment to debug this (and 
I'm a newbie). I think it doesn't distinguish single and double 
click. It is called every time one of the buttons is _toggled_. I'd 
say just minimize on double click would be an easy solution for this 
problem. No funky focus problems and not as annoying as on single 
click. See my above comments.

(As the anti crackrock people will not accept an option for this 
behavior it would be nice for it not to be to obstrusive, [But i 
know how to patch the code]).
Comment 17 Calum Benson 2002-06-20 16:49:36 UTC
The behaviour I see is click to maximize, double-click to minimize
again.  (This is Sun's RC1, though, so it's based on a snapshot from a
couple of weeks ago).

From a usability point of view, I would just add a word of caution--
having the user double-click a button to do anything kind of sucks. 
Buttons are designed to respond to a single click, and making them do
something else will mostly be undiscoverable in the first place, and
risks breaking users' expectations of buttons elsewhere on the desktop
if they do work it out.

Personally I always find that single-click to minimize/maximize works
perfectly well anyway, though (or it does when I use XP), so what do I
know...
Comment 18 Luis Villa 2002-06-27 20:28:20 UTC
*** Bug 86574 has been marked as a duplicate of this bug. ***
Comment 19 Havoc Pennington 2002-07-10 01:35:06 UTC
*** Bug 87792 has been marked as a duplicate of this bug. ***
Comment 20 Havoc Pennington 2002-07-10 03:18:51 UTC
*** Bug 4379 has been marked as a duplicate of this bug. ***
Comment 21 Havoc Pennington 2002-07-10 03:23:39 UTC
To me single click makes sense, if you think of the window list
buttons as toggle buttons, you toggle the button on to unminimize, and
toggle it off to minimize again. Of course it doesn't quite fly, since
the toggle really reflects whether the window is active not whether
it's minimized, but it still makes a certain amount of intuitive sense
perhaps.

Anyway, there are a lot of requests for this and I can't see it really
confusing/bothering anyone much... martin maybe elaborate on why you
find it harmful? Other than it not working right in 1.4?
Comment 22 martin H. 2002-07-12 10:55:50 UTC
Ok, I'll try.
This button have a lot of functions. Simply said it activates 
windows. But depending on WM and options that is not quite all. I'm 
using sawfish with maybe not that newbie options (don't focus new 
windows; don't raise on focus(and click to focus)).
In this setting Active(panel active == has focus) and raised 
(visible) get out of sync a lot and quite easy.
I'm using the tasklist a lot and sometimes don't pay attention 
whether a button is pressed (e.g. the window is focused) when I want 
to show and focus a window. It is annoing to me to minimize that 
window.

Yes, ok I admit this is a typical case of options make you life 
harder. Without these options a selected it would me easier for the 
developers. But I can't agree with Calum that using double click 
would risk our UI conistancy. It's broken anyway the only reason to 
have a tasklist with buttons is that other dekstops do it this way 
to and we don't have a good other idea IMHO.

Calum says that is is a lot of toggle buttons. According to the HIG:
Toggle buttons look similar to regular Buttons, but are used to show 
or change a state rather than initiate an action.

But fucosing and raising is an action to me.

So I'd prefer to have minimize on double click. This would avoid 
some surprises and dosn't add another function to the single click. 
But as I see this is not to easy because all processing is done in a 
callback connected to "toggle" of the button. I'm not sure why 
everybody says it curently minimizes on double click and I can't 
reproduce as my libwnck is patched to never minimize :-).

Do whatever seems right to you, my options maybe way of any 'sane' 
state.
Comment 23 Luis Villa 2002-07-12 14:45:56 UTC
Hrm. Not sure why I didn't mark this high/2.0.1 earlier but it seems
like it should be, given the frequency of requests.
Comment 24 Ecmel Ercan 2002-07-12 16:42:36 UTC
I would prefere minimizing on single-click.  This is the way most
Win32 users are get used to.  
Comment 25 John Sheehan 2002-07-15 14:34:15 UTC
Agree it should be single-click.  User feedback from Sun Beta
is that they find the current double-click inconsistent with 
expectation and experience on other desktops (e.g. Gnome 1.4
or Windows)

Moreover, it seems hard to get double click to register.
Usually it takes several double clicks to get the window
to minimize - not sure if this is a common experience or
just on Solaris.
 
Comment 26 Aschwin van der Woude 2002-07-15 15:02:01 UTC
The double-clicking is hard to trigger on my machine (Mandrake) as well
Comment 27 martin H. 2002-07-15 15:31:30 UTC
Ok, it seems the decision is to have this feature on single click.
With the policy issues out of the way it's just a window manager 
interaction thing. Here are some notes I can't help in solving this 
problem because of my patched libwnck.
Let me just state (again) that the code is bound to the 'toggle' 
changed signal (single click to toggle a button). So it's current 
behavior is a bug: wnck_window_is_active (task->window) seems to 
return false most of the time(the panel hass just been activated by 
the click into the taskapplet). As i see this it's just a raceing 
condition that lets this work most of the time.

Hope this helps to fix the problem. See my earlier comments for the 
names of the functions involved.

Havoc, what's the right thing to detect that the window has been 
active before the user clicks in the panel?
Comment 28 Havoc Pennington 2002-07-15 16:59:59 UTC
I think libwnck probably needs to keep a most-recently-used list 
of windows.
Comment 29 Arvind S N 2002-07-17 05:58:14 UTC
Just a thought, please let me know if i am wrong here.
Should we not be handling this in wnck_task_button_press_event.
When event->button == 1, call wnck_tasklist_activate_task_window. But
on a double click though, it could be that the window would maximise
and  minimise consecutively.We may need to avoid that somehow. 
Comment 30 Arvind S N 2002-07-31 15:21:31 UTC
Created attachment 10151 [details] [review]
Patch fixes the min/restore on single click.
Comment 31 Arvind S N 2002-07-31 15:23:19 UTC
Havoc: Please let me know if the approach is correct in the patch,
and if any changes are required, I will re-work on it. Thanks.
Comment 32 Havoc Pennington 2002-07-31 19:48:24 UTC
I believe it's possible that the was_active_task pointer becomes
invalid if that task disappears before you activate it. You may need
to NULL this pointer if the task is freed.
Comment 33 Arvind S N 2002-08-01 15:28:06 UTC
havoc: I see one more problem here, if the user clicked on the panel
or the desktop background,the window loses focus and  the
"was_active_task" should be set to NULL.I am not getting the right
condition to do that atm :(
Comment 34 Havoc Pennington 2002-08-01 16:38:36 UTC
Maybe you need an MRU list instead of a single pointer.
Comment 35 Arvind S N 2002-08-05 17:12:11 UTC
I tried the MRU one you suggested. If I am right the MRU list has to
be updated in the update_active_window() in screen.c . The
wnck_task_button_toggled()  is getting called after
update_active_window(), hence the MRU list would be updated with the
panel or the desktop the user would click upon, which beats our 
purpose of having the MRU list, assuming that I am in the right
direction with the way i am supposed to implement MRU list. Please
_correct_ me on that. Just checked that wnck_window_is_active() works
fine in the button_press_event. I am setting a flag here and minimize
the window in wnck_task_button_toggled() based on its value. We also
need to take care to disable the  double click, I think.



--- libwnck/libwnck/tasklist.c  2002/08/02 23:34:27     1.11
+++ libwnck/libwnck/tasklist.c  2002/08/05 16:49:32
@@ -84,10 +84,12 @@ struct _WnckTask

   /* task menu */
   GtkWidget *menu;
   /* ops menu */
   GtkWidget *action_menu;
+
+  gboolean was_active;
 };

 struct _WnckTaskClass
 {
   GObjectClass parent_class;
@@ -1440,12 +1442,13 @@ wnck_tasklist_activate_task_window     (

       wnck_window_activate (task->window);
     }
   else
     {
-      if (wnck_window_is_active (task->window))
+      if (task->was_active)
        {
+         task->was_active = FALSE;
          wnck_window_minimize (task->window);
          return;
        }
       else
        {
@@ -1822,10 +1825,17 @@ wnck_task_button_press_event (GtkWidget

       /* FIXME we should really arrange to destroy the menu on
popdown */

       return TRUE;
     }
+   else if (event->button == 1)
+     {
+        if (wnck_window_is_active(task->window))
+             task->was_active = TRUE;
+        else
+             task->was_active = FALSE;
+     }

   return FALSE;
 }
Comment 36 Havoc Pennington 2002-08-06 04:42:14 UTC
I think you'd probably scan back in the MRU list to find a window that 
would appear in the task list (ignore docks and such in the list).
Comment 37 Arvind S N 2002-08-06 15:08:08 UTC
*** Bug 90019 has been marked as a duplicate of this bug. ***
Comment 38 Arvind S N 2002-08-06 16:37:59 UTC
Created attachment 10304 [details] [review]
Another attempt to nail this bug
Comment 39 Arvind S N 2002-08-06 16:51:20 UTC
Havoc: Yes, 1.4 has the bug of the double click issue we talked on
irc. I have added a timeout of 150 msecs (arrived at the value based
on trial and error basically), in button_release_event callback 
to ignore double clicks and it works fine. Please let me know if this
patch is okay.
Comment 40 Seth Nickell 2002-08-07 07:34:34 UTC
Hi, just talked with Arvind on IRC. Don't have time to read through
all the comments to see if this has already been said, so brazenly
trudging ahead and posting.

I don't think double clicks should be treated specially. In our
standard widget "language" 3d controls like buttons, toggles, etc are
activated with single clicks, and flat things like icons that indicate
otherwise when you mouse over them are activated with double clicks.
Its ok if a user tries to double click the task bar once and finds out
that it does an unminimize followed by a minimize, or whatever. They
will learn quickly, because that is following the consistent behavior
for controls. 

What *will* be confusing is if they do double clicks and then never
quite remember if its a double click or a single click that "makes the
thing go". Its suprising how these sorts of things can actually cause
noticable hesitation every single time they want to do the operation.

This also dillutes the strength of our standard "single click to make
buttons do things" behavior across the desktop.
Comment 41 Luis Villa 2002-08-09 19:37:37 UTC
*** Bug 90339 has been marked as a duplicate of this bug. ***
Comment 42 Arvind S N 2002-08-10 14:14:44 UTC
Created attachment 10400 [details] [review]
Patch as per seth's suggestion.
Comment 43 Havoc Pennington 2002-08-10 15:29:14 UTC
Thanks, patch applied, turned out to be a really simple patch after
all that. ;-)
Comment 44 Shane O'Connor 2002-08-22 09:34:09 UTC
ok - I can verify that this is fixed so I am going to close - Dan,
hope this is ok.
Comment 45 Shane O'Connor 2002-08-22 09:34:28 UTC
closing