Re: Linux, X, ld, gcc, linking, shared libraries and stuff

From: Beth (BethStone21_at_hotmail.NOSPICEDHAM.com)
Date: 03/29/05


Date: Tue, 29 Mar 2005 15:29:00 GMT

Phil Carmody wrote:
> Sorry, pigybacking, as the following gibberer is in my killfile:

> Johannes Kroll wrote:
> > \\\\o//annabee wrote:
> >> Johannes Kroll wrote:
> >> > Possibly all true, but have you ever written a simple program that
> >> > creates a window and prints out all messages it receives? You'd be
> >> > surprised how many messages a single mouse click can generate ;)
> >>
> >> Yes, but it does not receive them, if you aim for another app ! If you
> >> aim for this app, then it SHOULD receive them. If you still dont want
> >> them :
>
> Just plain wrong. You have entirely misunderstood Beth's point, and are
> utterly ignorant of the power of the X Window system's event model.
> One of the fundamental design principles of X was that if there was a
> class of event that an application had no interest in receiving, then it
> would not receive them. One simple call to an API function was all it
took
> to indicate which classes were and weren't wanted.

Yeah; That's what I was saying but, somehow, he doesn't see it...

Also, the "one simple call" are the operative words there...it amazes me,
as I was also trying to say, that Microsoft completely "missed" this idea
themselves...what were they thinking? All it would have took is, indeed,
"one simple call" and then for Windows to store the parameter (which,
similar to X, could be implemented as a "bitfield" that just _one DWORD_
could be enough to split up the possible messages into 32 "categories"...if
you don't go "whole hog" to store more so that it's a more "fine-grained"
kind of "filter" :)...then just compare the message "type" to what's stored
and if it's not needed, then don't send...but it seems they simply didn't
think of it...they "missed" the opportunity...weren't in the right
"mindset" to realise this...

[ Plus, going beyond solely the application side of things to the GUI / OS
itself, there's even a possibility to _PROPOGATE_ this to improve the
overall GUI / OS performance...when an application doesn't want "mouse
messages" then Windows could not just not deliver any mouse messages to the
application, it could "propogate" this information down to the device
drivers too...inform the mouse device driver that we're only interested in
"mouse messages" for this and this and this area of the screen but not
anywhere else...then the mouse driver can carry on, of course, monitoring
the mouse and drawing the mouse cursor but when it's not inside any of the
defined "mouse message" areas of the screen, then the mouse driver doesn't
even bother sending "mouse messages" to the GUI / OS, even, let alone the
application...after all, this argument is just as equally applicable to the
GUI / OS itself, as it is to the applications running under the
GUI...though, yes, this would require a different design to the whole GUI /
OS...but, well, if someone out there is developing their own GUI OS or
something then, well, maybe you want to think that idea over, as you'd then
be kicking X's arse too, as well as Windows ;) ]

> And your statement also proves the truth of Beth's assertion that you
> argued against. That's really not very good argumentation style - you
> should at least put up a fight before shooting yourself in the foot so.

Yeah, I noticed that too...it's kind of funny, isn't it? He argues against
me by, ummm, exactly making a point that _proves_ what I was saying all
along...that, of course, was my entire point that Windows "unblocks"
applications for "false positive" / "false alarm" reasons all the
time...so, if Wannabee's "impressed" with the "blocking" scheme, then he
should be supporting _X_ more than Windows, because X's method doesn't keep
generating these "false alarms" that wake up blocked processes...

Perhaps this point might help Wannabee realise: There is no need for any
"DefWindowProc" API with X...because, if you want "default processing" then
you tell X not to even bother delivering it and it can "default process"
the event automatically without bothering the application at all...

Actually, I'm thinking that, simply, this idea is so obvious and simple
that it's not just Wannabee but also Microsoft who completely fail to see
how it works...because, truth is, I first learnt about Window's GUI...then
I learnt about X's GUI...and when I saw and understood what X was doing
here, it really was "kick yourself" time...it's so simple and so
obvious...but when you're "new" to "event-driven", this is enough to wrap
your brain around that you simply don't think of it...

Indeed, Wannabee, don't you remember my little story? Can't you see that
the story applies here just as much?

Remember, it was the story of the woman who went to the doctor...and the
doctor follows the inherently stupid "prescription before diagnosis"
practice, that he'd pulled out her kidneys before even bothering to examine
her to find out what was wrong (and it turns out she just had the flu, so
there was absolutely no need whatsoever to perform surgery and start
pulling out her organs ;)...

You found that story very funny...and it is because it's a completely
illogical way to go about giving people medical treatment...you must
_DIAGNOSE_ what's wrong before you know what the problem is, in order to
know what best "treatment" or "prescription" to give someone to get healthy
again...

Stop for a second and realise that this is exactly the situation we've got
here too...that you're defending the "prescription before diagnosis"
doctor...because what Windows does is send you "messages"
_regardless_...kind of like a doctor that just prescribes drugs randomly:
"Try this, try this, try this" without even working out what's wrong with
you, to know whether those are the correct drugs or not...

And X's method is the logical way doctors _actually_ do things...when the
application comes into the doctor's clinic, it says: "I think I've got the
flu" / "I've got a bad back" _BEFORE_ the doctor starts handing out drugs
and prescribing that it undergoes surgery or whatever...

It's very simple...the application tells X what "events" it is interested
in (the ones it actually bothers to respond to and process :) then X simply
only sends those "events"...

> Johannes - "The sensible thing would be a message filter" - indeed.
> The guys in MIT knew that 2 decades ago. That was designed into X from
> the very start.

Correct; The basic problem is that Windows and the PC now totally
"dominate" that people don't know much about what was before or what is
going on "elsewhere"...and Microsoft's PR and advertising says "we
innovated every technology! We have the best technology there is!"...and,
simply, it's utter crap...as truthful as when the chewing gum company's
adverts "imply heavily" that if you chew their chewing gum, you'll become
rich and famous and everyone will Love you (by showing an actor that looks
poor and has no friends, all filmed with lots of grey colours and low
brightness...then, hey presto, he pops chewing gum into his mouth...then
the "brightness" dial is turned up, colours appear and - completely
spontaneously - a party full of supermodels springs up and everyone dances
in this blissful Utopia of ever-lasting perfectness...wow! That's one heck
of a strong chewing gum they've got there! As well as bringing about world
peace, ending world hunger, infecting everyone with "disco fever" and
instantly arranging a party full of supermodels, it seems able to also turn
the "brightness" and "colour" dials up on your TV set too...oh, come on,
MTV generation, you've been raised up on this crap...surely, by now, it
ceases to have any effect and merely turns up the "cynicism" and
"disbelief" dials instead? ;)...

After all, if you've only ever drunk one brand of wine for your entire
life, then you cannot possibly qualify as a "wine connoisseur", can you?
You don't know if it's "better" or "worse" than any other wine because
"better" and "worse" are _COMPARATIVE_ words...the judgements "better" or
"worse" made _RELATIVE_ to something else...this is surely all very
logical, yes? You can see how this works? You'll say "yes"...but we already
know there's another "phantom book review" just around the corner, which
tries to say that something is "better" in absolute terms, when the word
"better" is, and always was, a _COMPARATIVE_ that it's logically impossible
to use the word absolutely or in isolation...but this doesn't matter
because the chewing gum advert, the shampoo advert and Microsoft PR -
through constant abuse of this "it's better!" comparative without any
qualification - has "trained" you not to even see the inherent illogic of
that anymore...as Bernhard put it: "Distorted Brain Programming" ;)...

Beth :)