Bug 115226

Summary: middle mouse click doesn't behave like before
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Lars Müller <lmuelle>
Component: KDEAssignee: E-mail List <kde-maintainers>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: dickey, sndirsch, werner
Version: Beta 4   
Target Milestone: ---   
Hardware: i686   
OS: SUSE Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: xterm patch

Description Lars Müller 2005-09-04 15:36:46 UTC
It's still possible to perform a vertical maximize with a middle mouse click to
the maximize button to a KDE managed window.

But it's no longer possible to restore the previous size with a middle mouse
click again.
Comment 1 Stephan Kulow 2005-09-06 09:18:29 UTC
works fine here. I guess your bug report is incomplete. I tested with a 
konsole window 
Comment 2 Stephan Kulow 2005-09-06 16:24:39 UTC
checking again with Lars: it only exists for xterm - most likely because of 
the work around we had to add 
Comment 3 Dirk Mueller 2005-09-06 16:36:21 UTC
yes, thats the kwin problem that was introduced with 3.4. it drives me mad as 
well.  
 
 
Comment 4 Dirk Mueller 2005-09-06 16:37:01 UTC
Lubos, any chance we can have a working xemacs and xterm again? 
 
 
Comment 5 Lubos Lunak 2005-09-07 12:32:16 UTC
Sure, just fix them.  
It's rougly like this: Either we revert the patch for #61153, then maximize will work 
normally but xterm and xemacs will do all those funny things, or we don't revert the 
patch and just swap the consequences. Both cases can be selectively changed using 
window-specific settings. That's about it that can be done for SL10.0, I'm not going 
to rewrite the complete code for maximizing in kwin right now just because xterm 
and xemacs can't get things right. 
 
Comment 6 Dirk Mueller 2005-09-07 18:31:12 UTC
*sigh*.. there must be some solution so that both works.. perhaps even with 
fixing the applications.  
 
however there are some that we can not fix like e.g. opera, which has the same 
issue.  
 
  
Comment 7 Dr. Werner Fink 2005-09-08 08:30:37 UTC
Hmmm ... I'd like to know why xterm or xemacs works with e.g. fvwm2
but not with kwin?  With SuSE Linux 9.2 we had a problem with GNOME
and the resize command from the GNOME system where the xemacs was not
able to handle the resize command in pixel size but only in muliples
of the font metric which leads to a flood of resize commands from
GNOME and the resulting but helpless resize attemps of xemacs.
Comment 8 Dirk Mueller 2005-09-08 08:40:47 UTC
basically it comes down to: fvwm2 is not a NETWM compliant window manager, so 
it just happens to work by accident 
Comment 9 Dr. Werner Fink 2005-09-08 08:43:54 UTC
Ahmmm ... sorry then any NETWM compliant window manager has to
ask its clients if they can handle NETWM.  The world is not
KDE nor NETWM.
Comment 10 Mike Fabian 2005-09-08 08:53:14 UTC
Dirk> basically it comes down to: fvwm2 is not a NETWM compliant window manager, so 
Dirk> it just happens to work by accident

fvwm2 claims to be NETWM compliant.

Comment 11 Mike Fabian 2005-09-08 08:55:34 UTC
Add xterm author Thomas Dickey to CC: because of comment #5.
Thomas should know whether something needs to be fixed in xterm.
Comment 12 Lubos Lunak 2005-09-08 09:51:48 UTC
No, as explained in the original bugreport for this, it's like this:  
ICCCM section 4.2.4 (http://tronche.com/gui/x/icccm/sec-4.html#s-4.2.4) says that  
applications should try to cope with any size they get. Additionally in section 4.1.2.3  
there's a description of hints using which the applications may ask (i.e. hint, not  
demand) geometry they'd like, but they're not guaranteed to get it (because, if  
nothing else, the WM simply may not implement the feature).  
XEmacs's fault is that it's not compliant with section 4.2.4 and when it doesn't get  
exactly the geometry it requested it tries to force it (which leads to things like 
described in comment #7). XTerm also expects to always get the geometry it gets 
and that results in the cut last line if the geometry is not exactly the expected one 
(this can be easily fixed by e.g. cutting the topmost line instead). 
In KWin maximized state is defined as geometry == workarea. For windows that 
expect resize increments KWin therefore deliberately ignores them in order to fit the 
size exactly to the size of the workarea, and as explained above ICCCM allows this. 
With the workaround KWin strictly obeys the requested geometry, but then this 
geometry sometimes doesn't exactly match the workarea and therefore the window is 
never really maximized, leading to this bugreport. 
FVWM2 etc. work because they are not so strict in this area or they don't depend on 
section 4.2.4 at all; this has nothing to do with NETWM. 
Given the timeframe the only feasible solution seems to be picking which breakage 
should be the default and either keeping or reverting the KWin patch. 
 
Comment 13 Mike Fabian 2005-09-08 13:22:17 UTC
as far as XEmacs is concerned, is this related to bug #103040 ?
Comment 14 Lubos Lunak 2005-09-08 13:38:07 UTC
Bug #103040 is basically the same problem. This bugreport is actually about a  
problem resulting from a workaround for that problem.  
 
Comment 15 Dirk Mueller 2005-09-12 12:27:38 UTC
how about treating a window as maximized if it is really close in size to the 
workarea? 
 
in all cases so far this was just a few pixels (3-4 usually) and in the user's 
perception a window that is 3-4 pixels smaller in height is still maximized.  
 
 
Comment 16 Dr. Werner Fink 2005-09-12 12:41:46 UTC
I fully agree with you ;)
Comment 17 Lubos Lunak 2005-09-12 12:52:29 UTC
But it's not maximized in kwin's perception and I'm not going to risk rewriting that   
code for SL10.0 just because few apps cannot get it right. And even post-10.0 I don't  
like the idea that much.  
 
Comment 18 Dr. Werner Fink 2005-09-12 13:03:26 UTC
Hmmm ... a character based window can not switch to any size.  Maybe
konsole cuts off some pixel or add some pixel, but IMHO this is not
what the user expects. Beside this IMHO add or removing pixel looks
terrible.   IMHO it is a clear bug of kwin not accepting nearby
window sizes after a request as this was for the GNOME window manager.
Comment 19 Lubos Lunak 2005-09-12 14:30:20 UTC
Ok, once more:  
  
ICCCM section 4.2.4 (http://tronche.com/gui/x/icccm/sec-4.html#s-4.2.4):  
"The response of the client to being resized should be to accept the size it has been  
given and to do its best with it. Clients must not respond to being resized by  
attempting to resize themselves to a better size. If the size is impossible to work  
with, clients are free to request to change to the Iconic state." => XEmacs behaviour  
is non-compliant.  
  
ICCCM section 4.1.2.3 (http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.2.3):  
"The base_width and base_height elements in conjunction with width_inc and  
height_inc define an arithmetic progression of __preferred__ window widths and  
heights for nonnegative integers i and j:" (emphasis mine). Also please note the  
following part about aspect ratios uses sentences like "Window managers that honor  
aspect ratios should". Similarly introductory parts of section 4 and section 4.2.2 make  
it quite clear that, in simple speech:  
  
The window manager is the big boss who has the final say. Clients make polite  
requests, the window manager decides whether and how it honours the request. This  
makes it possible to develop new WMs with new UI paradigms (show this discussion  
to developers of some of the new WMs like e.g. Ion and I'm quite sure you'll hear the  
swearing). Also, the app may not rely on it also because the WM may not simply 
implement the feature. 
 
As for xterm/xemacs not being able to add or remove pixels, for xterm it clearly  
works at the bottom, so it shouldn't be a big problem to do it at the top instead.  
Xemacs has some graphical elements, so I fail to see how a couple of pixels can be a  
problem.  
 
Comment 20 Dr. Werner Fink 2005-09-12 14:43:12 UTC
Ahmm ... I'm _not_ talking about theory but real life.
IMHO at this two points ICCCM are devil for any character
based window program and force the developer to add
not needed code for nothing.
Comment 21 Thomas Dickey 2005-09-12 20:56:00 UTC
Isn't this the same as #61153 ?

As I noted there, the case for maximize is a less complicated problem
than the one that I've been working on with xterm's toolbar.  Looking
at _that_ yesterday, it appears to be fixed in my pending changes by
a small patch to screen.c (and will probably be in a #205 patch later
this week).
Comment 22 Dirk Mueller 2005-09-13 06:49:00 UTC
yes, its much related to #61153, they both have the same cause, just from 
different viewpoints 
Comment 23 Lubos Lunak 2005-09-14 10:57:48 UTC
> IMHO at this two points ICCCM are devil for any character based window program 
> and force the developer to add not needed code for nothing. 
No. In fact in both cases the fix seems to be about removing code. For example, the 
attached xterm patch seems to fix the problem, and as you can see xterm actually 
tries to handle this case, it just gets it wrong. I can't guarantee it's a complete fix, 
because I needed almost one hour to find the place (and a couple of minutes for the 
actual fix), but it works for me. 
For the xemacs case I'd expect the solution to be something along the lines of 
finding the place in sources where a comment says "the WM didn't give us exactly 
the geometry we want, so let's try to screw things up by forcing it again ourselves" 
and dumping that code. It seems xemacs actually can handle all geometries just 
fine, so it shouldn't be necessary anyway. 
 
Comment 24 Lubos Lunak 2005-09-14 10:58:35 UTC
Created attachment 49888 [details]
xterm patch

This patch seems to fix the incomplete last line xterm bug.
Comment 25 Thomas Dickey 2005-09-14 11:43:36 UTC
I already applied that change a few days ago, as you might have
guessed if you had read my comment #21.
Comment 26 Stefan Dirsch 2005-09-30 14:16:30 UTC
Btw, I've updated to xterm-205 for openSUSE 10.1 Alpha1.
Comment 27 Stephan Kulow 2005-10-06 14:04:24 UTC
ok, I think we took care enough of this enough for now. And for xemacs is 
another bug open