xRaiseWindow doesn't work (how to change attributes?)

This is a discussion on xRaiseWindow doesn't work (how to change attributes?) within the Xwindows forums, part of the Tools category; My real question is: Is there a shell tool way to change the attributes displayed by xwininfo? Background: I have a program that figures out the window ID for a ...

Go Back   Unix Linux Forum > Technologies & Tools > Tools > Xwindows

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 10-06-2008, 04:05 PM
Default xRaiseWindow doesn't work (how to change attributes?)

My real question is: Is there a shell tool way to change the attributes
displayed by xwininfo?

Background: I have a program that figures out the window ID for a
window, then invokes the xRaiseWindow() function on it. However, I have
found that it doesn't work - the window is not raised (but no error is
generated as far as I can tell). This program has worked fine in the
past - on other versions of Linux and on Solaris - so I don't think
there is a code problem.

But "man xRaiseWindow" says that if the override_redirect is "no" (and
some other condition that escapes me at the moment), then the window
will not be raised. I see in xwininfo that override_redirect is "no"
and I'd like to change that.

Reply With Quote
  #2  
Old 10-06-2008, 07:58 PM
Default Re: xRaiseWindow doesn't work (how to change attributes?)

On Oct 6, 1:05*pm, gaze...@shell.xmission.com (Kenny McCormack) wrote:
> My real question is: Is there a shell tool way to change the attributes
> displayed by xwininfo?
>
> Background: I have a program that figures out the window ID for a
> window, then invokes the xRaiseWindow() function on it. *However, I have
> found that it doesn't work - the window is not raised (but no error is
> generated as far as I can tell). *This program has worked fine in the
> past - on other versions of Linux and on Solaris - so I don't think
> there is a code problem.
>
> But "man xRaiseWindow" says that if the override_redirect is "no" (and
> some other condition that escapes me at the moment), then the window
> will not be raised.


Not quite. If override_redirect is False AND the window manager has
selected SubstructureRedirectmask on the parent window, then the
raisw window request is sent to the window manager instead of
acting immediately. The window manager may either raise the window
or refuse to do so,

>*I see in xwininfo that override_redirect is "no"
> and I'd like to change that.


Use XChangeWindowAttributes() to change the overrided_redirect
attribute.

Also, are you SURE you are getting the correct window ID? Which one
do you want - the window you created, or the window that the window
manager wraps it in?


--
Fred Kleinschmidt
Reply With Quote
  #3  
Old 10-07-2008, 01:41 PM
Default Re: xRaiseWindow doesn't work (how to change attributes?)

[Docter, it hurts when I do *this*]

Kenny McCormack wrote:

> Background: I have a program that figures out the window ID for a
> window, then invokes the xRaiseWindow() function on it. However, I have
> found that it doesn't work - the window is not raised (but no error is
> generated as far as I can tell). This program has worked fine in the
> past - on other versions of Linux and on Solaris - so I don't think
> there is a code problem.


It depends on the policies set by the window manager.

Take KWin for example. Using the default settings, it simply marks the
window as REQUESTING ATTENTION. The task manager will flash it's button
a few times, then hilight it. It can play a audio clip or show a pop-up
window to draw even more attention. You can also change it's behavior
so that the window will be raised immediately.

> But "man xRaiseWindow" says that if the override_redirect is "no" (and
> some other condition that escapes me at the moment), then the window
> will not be raised. I see in xwininfo that override_redirect is "no"
> and I'd like to change that.


It won't help you! After a window is created, but before it appears
on the screen the Application Window is just another child of the Root
Window:

Root Window
Application Window

But after it has been mapped (made visible) it will have been adopted by
the window manager. The window hierarchy will /typically/ look like
this:

Root Window
Frame Window
Decoration Window
Decoration Objects...
Client Window
Application Window

So, even if you set the override_redirect on the Application Window,
XRaiseWindow can only raise it within the Client Window.

(The -frame option to xwininfo will get you the Frame Window, but
messing with the window manager's windows seems like a whole new kind of
stupid to me.)

--
Huibert
"Hey! HEY! Curious cat, here!" -- Krosp I (GG)
Reply With Quote
  #4  
Old 10-08-2008, 11:03 AM
Default Re: xRaiseWindow doesn't work (how to change attributes?)

In article <939aa2e6-9f63-4446-aae7-964fc77a87db@w1g2000prk.googlegroups.com>,
Fred wrote:
>On Oct 6, 1:05*pm, gaze...@shell.xmission.com (Kenny McCormack) wrote:
>> My real question is: Is there a shell tool way to change the attributes
>> displayed by xwininfo?
>>
>> Background: I have a program that figures out the window ID for a
>> window, then invokes the xRaiseWindow() function on it. *However, I have
>> found that it doesn't work - the window is not raised (but no error is
>> generated as far as I can tell). *This program has worked fine in the
>> past - on other versions of Linux and on Solaris - so I don't think
>> there is a code problem.
>>
>> But "man xRaiseWindow" says that if the override_redirect is "no" (and
>> some other condition that escapes me at the moment), then the window
>> will not be raised.

>
>Not quite. If override_redirect is False AND the window manager has
>selected SubstructureRedirectmask on the parent window, then the
>raisw window request is sent to the window manager instead of
>acting immediately. The window manager may either raise the window
>or refuse to do so,


Yes. Hence the phrase above "(and some other condition that escapes me
at the moment)".

>>*I see in xwininfo that override_redirect is "no"
>> and I'd like to change that.

>
>Use XChangeWindowAttributes() to change the overrided_redirect
>attribute.


Of course. I was looking-for/asking-about a "shell tool" that would do
that (like xprop).

>Also, are you SURE you are getting the correct window ID? Which one
>do you want - the window you created, or the window that the window
>manager wraps it in?


I probably don't understand enough of the underlying plumbing to answer
that question intelligently. However, I know that this program (exact
same source code - compiled with exactly the same 'gcc' command line)
works fine on two other platforms (version of OS, X, window manager,
etc, etc), but fails here. Not sure why. Thought maybe it had to do
with the stuff alluded to above.

Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 12:43 AM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger