Bug 103040 - XEmacs shrinks in a loop
Summary: XEmacs shrinks in a loop
Status: RESOLVED FIXED
: 104080 (view as bug list)
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: KDE (show other bugs)
Version: Beta 1
Hardware: All All
: P5 - None : Normal (vote)
Target Milestone: Beta 1
Assignee: Dr. Werner Fink
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-09 14:24 UTC by Michael Radziej
Modified: 2007-12-06 10:44 UTC (History)
6 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
testapp (330 bytes, text/x-c++src)
2005-10-13 19:45 UTC, Lubos Lunak
Details
test.c (1.94 KB, text/x-csrc)
2006-02-10 16:42 UTC, Lubos Lunak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Radziej 2005-08-09 14:24:10 UTC
I start XEmacs (under KDE). Then I press "full screen". XEmacs grows to almost
full-screen size, then it shrinks itself horizontally for a random value. I try
it again, and same result, only it now gets a different width. And so on.
Beware, you might catch nausea from watching.

I've seen the same behaviour under 9.3 but always blamed it on my configuration.
Now it's on my test box, too.
Comment 1 Dr. Werner Fink 2005-08-09 14:29:35 UTC
Noone of us have ever seen this with KDE but only with GNOME.
Comment 2 Michael Radziej 2005-08-09 14:36:35 UTC
It looks really funny. If anyone would want to take a look, I have everything
ready here.
Comment 3 Klaus Kämpf 2005-08-09 15:55:40 UTC
Why is this component 'YaST2' ? 
 
BTW, Michael, its more convenient to attach a screenshot. 
Comment 4 Michael Radziej 2005-08-09 16:07:07 UTC
It shouldn't have been component YaST, sorry. It's not possible to show in a
screenshot since the XEmacs window actually moves. I'd need a screen movie
maker. ;-)
Comment 5 Lubos Lunak 2005-08-15 11:41:37 UTC
*** Bug 104080 has been marked as a duplicate of this bug. ***
Comment 6 Lubos Lunak 2005-08-15 11:56:25 UTC
It's not fullscreen, it's maximize. And for reproducing it is necessary that the space 
for maximizing is not an exact multiple of xemacs' resize increments, so you may 
want to shuffle around your panels in order to reproduce. 
 
This is xemacs bug. It tries to fight back the window manager when it gets a side it 
doesn't quite like, although the ICCCM (section 4.2.4) is quite clear on the fact that 
it should try to cope with any size it gets and not do this. In KDE this can be worked 
around in Alt+F3/Special window settings/Workarounds and enabling Strictly obeying 
geometry, and I think I can enable this by default for SL10.0. Then maximize doesn't 
actually really work, but do I need to repeat this is xemacs bug? 
 
Comment 7 Michael Radziej 2005-08-15 12:45:36 UTC
I can confirm that the work-around works. Thanks!
Comment 8 Mike Fabian 2005-08-15 16:09:28 UTC
Werner fixed a very similar bug for XEmacs a while ago.

Werner, is it possible that the fix in XEmacs is not complete?
Comment 9 Dirk Mueller 2005-08-18 09:06:00 UTC
Lubos: imho such workarounds for broken applications should be added to the 
default package. 
Comment 10 Torsten Duwe 2005-08-18 11:07:14 UTC
I assume this is platform independent. 
Comment 11 Mike Fabian 2005-09-08 13:26:24 UTC
Werner, do you have any idea?

Is this related to bug #115226 ?
Comment 12 Mike Fabian 2005-09-08 13:29:31 UTC
By the way, I cannot reproduce the behavior described in the original
comment on beta4. Michael, can you still reproduce this?

On beta4, clicking the maximise button of the window title maximizes
XEmacs but clicking it again doesn't reproduce the original size.
Comment 13 Dr. Werner Fink 2005-09-08 13:33:39 UTC
Yep IMHO it could be. Btw: the workaround to break the ping/pong
between the size request and the not so good responce of xemacs
was done by me for SL 9.2

-> /work/SRC/old-versions/9.2/all/xemacs/xemacs-21.4.15-gnomebug.dif

... maybe we should re-add this to enable xemacs to ignore several
resize attacks from the window manager.
Comment 14 Mike Fabian 2005-09-08 14:06:43 UTC
I'm not sure whether your patch will still apply cleanly because
the upstream developers also tried to fix it in the meantime after
looking at your patch. But they "solved" it slightly differently.
Comment 15 Mike Fabian 2005-10-11 14:34:10 UTC
Mike> On beta4, clicking the maximise button of the window title maximizes
Mike> XEmacs but clicking it again doesn't reproduce the original size.

This is still the case with 10.0 final.

And the update to XEmacs 21.5.22 doesn't fix it either.

(XEmacs 21.5.22 packages for SuSE 10.0 are available at

    ftp://ftp.suse.com/pub/projects/m17n/10.0

and of course already in STABLE).



Comment 16 Dr. Werner Fink 2005-10-13 15:15:12 UTC
I've added a vew fprintf to stderr to see what happens in the
callback of the Xt interface.  It seems that KDe does not provide
the correct data at least on x86_64.

The xemacs uses the following callback of the Xt interface:

        initialize
        realize
        resize
        set_values
        query_geometry

this is enough to work e.g. with the old KDE, fvwm2, GNOME.
Beside this for the

         actions

callback table of the Xt interface is only used to for the

         <Mapping>

entry.  Beside this the xemacs does it right, this because
the values for width/height are provided by Xt and xemacs
does only react on this values.

IMHO this looks like the KDE does not provide the correct
values for width/height in case of maximize/minimize. 
Comment 17 Lubos Lunak 2005-10-13 19:45:18 UTC
Created attachment 53976 [details]
testapp

Sigh. How many more times do I need to repeat this? The bug is that xemacs tries to fight back geometry changes from the window manager. That's what's causing the loops. Run X in failsafe mode with one xterm and launch xemacs. Use xwininfo to get the window id of the xemacs window. Run this testapp as "./testapp <windowid> <width> <height>", with width and height being e.g. 402/302, the testapp will resize the window just like if it was a window manager. Run xwininfo on the xemacs window again, this time check the window width and height. If you'll be lucky and they'll actually match the geometry you used just go one up to 403/303 and repeat until you see that the geometry doesn't match. Now read http://tronche.com/gui/x/icccm/sec-4.html#s-4.2.4 , especially the second sentence in the second paragraph and tell me what's still not clear.

> It seems that KDe does not provide
the correct data at least on x86_64.

Well, given the above and the fact that pretty much everything except xemacs works I don't think this is true or relevant, but if you want to argue this way I'm afraid you'll have to provide something more than just this mere claim.
Comment 18 Dr. Werner Fink 2005-10-14 09:17:15 UTC
First of all your test application is not Xt nor Motif based.
The KDE manager provides the _WRONG_ width/height if the
application uses XT or XT/Motif.

Second: the Xemacs of SL10 does _NOT_ fight back geometry changes.
This is and was fixed by me since SL9.2 for the GNOME manager.
With this patch the Xemacs try to fit as near as possible to the
request of the manager at least with in the charactes cell size.
Further request wil lbe answered with XtGeometryAlmost which is
what Xt provides in this case.

Third: There are many other applications based on Xt or Xt/Motif
which handle this in the same way.

Fourth: Im' not interessted in http://tronche.com/gui/x/icccm/sec-4.html#s-4.2.4
nor I'm willingly to rewrite the Xt engine of Xemacs.

Fifth: Give the Xt and Xt/Motif based applications a chance to 
work together with KDE or I'll do this for you.
Comment 19 Lubos Lunak 2005-10-14 09:43:22 UTC
First: It's completely irrelevant if the testapp is or is not Xt or Motif based. For 
testing purposes it's a window manager that demostrates xemacs does fight back 
geometry changes. That's rather obvious from the fact that it resizes xemacs to 
some size and the window ends up with a different size. 
 
Second: See previous two sentences. 
 
Third: Like? Not that it really matters, if there are such apps they're just as well 
broken, but I'd like to check. 
 
Fourth: And I'm not interested in you not being interested in standards. Moreover the 
"rewrite" of the Xt engine of xemacs is most probably a one-liner, just like with 
xterm. 
 
Fifth: They have it. 
 
Comment 20 Ruediger Oertel 2005-10-14 09:53:24 UTC
btw: xterm shows the same behaviour 
same for gnome-terminal 
 
 
Comment 21 Dr. Werner Fink 2005-10-14 10:08:42 UTC
The new xterm 205 does NOT work.  This one line is useless.
The gnome-terminal does not work.
The Xemacs does not work.
Don't know how many other Xt/Motif based programs do not
work together with KDE.

Fix this in KDE.
Comment 22 Mike Fabian 2005-10-14 10:12:28 UTC
I can confirm that xterm 205 on SuSE 10.0 shows the same behaviour.

(xterm 205 for SuSE 10.0 is available in
ftp://ftp.suse.com/pub/projects/m17n/10.0/RPMS/)
Comment 23 Mike Fabian 2005-10-14 10:15:10 UTC
Add xterm author Thomas Dickey to CC:.
Comment 24 Dr. Werner Fink 2005-10-14 10:18:15 UTC
Btw: all those Xt applications which are not supported by KDE
anymore do the same thing: they doe not answer the resize
request from the KDE manager with the exact values but with
values nearby ... well known in Xt as XtGeometryAlmost.
Comment 25 Lubos Lunak 2005-10-14 10:42:53 UTC
So KDE developers are now also responsible for fixing broken old toolkits like Xt? Ok  
*shrug*.  
  
Xterm 205 does work. It's just that SL10.0 has enabled a workaround for the  
cuts-last-line bug of older xterm versions, if you set Alt+F3/Advanced/Special window  
settings/workarounds/strictly obey geometry to force and leave the checkbox  
unchecked, it'll work just fine. Gnome-terminal kind of works too, you just have to 
maximize twice, don't ask me why.  
 
Comment 26 Dr. Werner Fink 2005-10-14 10:51:04 UTC
Hmmm ... and how do you want to fix the statically linked Motif
applications out there?  Do you want force all customers out there
to do Alt+F3/Advanced/Special ... ??

Btw: This `maximize twice' I've seen also with xemacs on _some_
screens.  This looks like using the first mouse button twice works
like pressing the second mouse once ... but in my case with this
screen the width remains maximized whereas the height changed.

And ... on other screens nothing happens with the exact same
binary Xemacs.   And the numbers get from the KDE via the Xt
interface are definitly the new geometry _almost_ used by the
Xemacs.
Comment 27 Mike Fabian 2005-10-14 12:09:56 UTC
Lubos> It's just that SL10.0 has enabled a workaround for the cuts-last-line
Lubos> bug of older xterm versions, if you set Alt+F3/Advanced/Special window
Lubos> settings/workarounds/strictly obey geometry to force and leave the
Lubos> checkbox unchecked, it'll work just fine.

If you do this for xemacs, xemacs will start shrinking after maximising
until only a narrow strip at the left border of the screen remains.

Comment 28 Thomas Dickey 2005-11-14 00:29:51 UTC
Regarding comments 20-22: I can only guess (xterm is wobbling around
the screen?).  Sounds like KDE is the moving target, since xterm's
working acceptably on the version of KDE I have in Debian/testing.
Current xterm patch is #207, but the changes for layout since 205
are minor - still wouldn't hurt for someone to test current code
with the KDE du jour.
Comment 29 Stefan Dirsch 2005-11-14 10:42:40 UTC
I'll try to update xterm to -207 for Alpha3 to release this week.
Comment 30 Lubos Lunak 2005-11-14 13:46:52 UTC
Re #27: Yes, for about a zillionth time, this is known, xemacs is broken.
Re #28: As already said in #25, xterm 205 and up works, if the workaround is disabled as described there. Nothing more needs to be done WRT xterm.

Comment 31 Thomas Dickey 2005-11-15 00:50:38 UTC
ok - I guess.  There are two fixes in #206 for layout, but they're
much less noticeable than "wobbling".  When I committed #206, the
only problems I had with KDE were with the toolbar configuration
(which SuSE is not using).
Comment 32 Dr. Werner Fink 2005-11-15 10:46:35 UTC
Currently "wobbling" is a problem with KDE libs.  Im case of
a maximize request the KDE manager expects the exact pixel size
as new geometry of the client. Any offset due XtGeometryAlmost
will be answered by the KDE manager with a new request but with
wrong values. The GNOME manager force also a new request for
XtGeometryAlmost but with correct values.
Comment 33 Lubos Lunak 2006-02-10 16:40:54 UTC
This problem is caused by a patch that seems to work around xemacs' maximize problems in GNOME (namely gnomebug.patch), it can be clearly demonstrated by building unpatched xemacs, trying it, building again with only this patch and trying again. So much for KDE providing wrong values or whatever.

If the patch is considered needed for GNOME's Metacity, I suggest making that code optional only for the case when this WM is running. I'll attach a small testapp with a function that detects which WM is running (note the function is several X roundtrips and as such should be probably called only once during startup).
Comment 34 Lubos Lunak 2006-02-10 16:42:20 UTC
Created attachment 67664 [details]
test.c

Testapp finding out if Metacity is running.
Comment 35 Stephan Kulow 2006-02-10 16:53:58 UTC
I'm testing unpatched xemacs with metacity
Comment 36 Stephan Kulow 2006-02-10 17:20:18 UTC
OK, unpatched xemacs works perfect in metacity - trying to find out why leaves as an exercise to the interested reader. For this bug we're done

*making 3 crosses* 
Comment 37 E. Choroba 2007-12-05 21:19:17 UTC
I have a similar problem with emacs in kde. I am using openSUSE 10.3, emacs 22.1.1 (rpm emacs-22.1-40.7), kde 3.5.7 (rpm kdebase3-3.5.7-87). I start emacs and press the Maximize button: emacs becomes almost maximized, but not totally. It does not provide Restore button, it keeps the Maximize button - and when I press it once more, emacs becoms fully maximized with the Restore button. Pressing it does not restore the previous size of emacs, but it restores the almost maximized size.

The described workaround does not solve the problem.

I tried to download emacs source (v22.1) and compile it myself. Emacs compiled without gtk widgets works fine, emacs compiled with gtk widgets behaves as described above. In other window managers, emacs never has the problem (tested with blackbox and gnome).
Comment 38 E. Choroba 2007-12-05 21:51:09 UTC
I'm sorry. I did read all the comments but I did not understand them clearly. Reading them once more I realize the problem should have been solved (#36). Then I just do not understand why I still have the problem...
Comment 39 Dr. Werner Fink 2007-12-06 10:44:55 UTC
You're are talking on Xemacs or GNU Emacs?  Please do not
reopen an old and solved bug but open a *new* bug against
the Product openSUSE 10.3