resize question: XReparentWindow() related
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > resize question: XReparentWindow() related




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    resize question: XReparentWindow() related  
kodgehopper


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:18 PM

Hi

I'm new to Xwindows programming (tho not to programming itself), and I
have a question involving XReparentWindow(). I'm using XFree86-4.3

What I want is to create a window of a certain size, say 500x500, and
start mplayer (a movie player)in full screen in that window. BUT, I want
mplayer to use 500x500 as it's fullscreen size, and not the size of the
entire screen. In other words, I want mplayer to think the small 500x500
window I've created is the full screen. This must be done transparently.
The user must not have to manually rescale mplayer to the size of the
window. The user must just type -fs (for fullscreen mode) and that must
use the dimensions of the 500x500 window automatically.

At the moment, I'm executing the following sequence of steps:
1. create 500x500 window
2. start mplayer in fullscreen mode
3. reparent mplayer to 500x500 window

The end result is that mplayer uses the dimensions of the entire screen
when going to fullscreen mode, so when it's reparented, I only see a small
portion of the video in the 500x500 window.

I think this happens because mplayer originally starts up as a child of
the root window from which it gets its dimensions for fullscreen mode.
Then when I reparent, it's still using those original settings which is
why I see a clipped version of the video.

So my questions are:
1. How do I get mplayer to use the 500x500 window's dimensions when going
to fullscreen mode? note that mplayer will probably be started from
.xinitrc or some other application, so i can't create the 500x500
window then run exec() from it.
2. Is there a way to trap an event indicating that an application is going
to start running and then force that application to run in the 500x500
window? i.e. force the application to start up originally as a child
window of the 500x500 window, and not of the root window?


Thanks in advance

kodgehopper
kodgehopper at netscape dot/point net

(email specified as above to avoid spam. sorry for the inconveniece)






[ Post a follow-up to this message ]



    Re: resize question: XReparentWindow() related  
Chuck Dillon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:18 PM

kodgehopper wrote:
quote:
> > ... In other words, I want mplayer to think the small 500x500 > window I've created is the full screen. This must be done transparently. > > ... > > So my questions are: > 1. How do I get mplayer to use the 500x500 window's dimensions when going > to fullscreen mode? note that mplayer will probably be started from > .xinitrc or some other application, so i can't create the 500x500 > window then run exec() from it.
There are no easy solutions to this. You could modify a window manager to have special handling of a particular application but there is no robust way to identify which application to apply the special handling to. It would probably be very ugly. Another posible solution would be to use xnest, which is an xserver that uses a window of another xserver as the display device, and run the app against it. That way the app interacts with a real xserver that is configured as you want it. To direct the app to the embedded xserver you would have to replace it's binary with a wrapper script. Again this could get involved if you need a window manager running in the nested display. I don't think you would though.
quote:
> 2. Is there a way to trap an event indicating that an application is going > to start running and then force that application to run in the 500x500 > window? i.e. force the application to start up originally as a child > window of the 500x500 window, and not of the root window?
Use a wrapper script. X doesn't include the concept of an application or a program. It deals with windows. The best you can do is look for standard properties and infer from them what app is associated with the windows. Not all apps follow the conventions and if you don't do this in a custom window manager it can get tricky. I suggest you follow-up to comp.windows.x. -- ced -- Chuck Dillon Senior Software Engineer NimbleGen Systems Inc.




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:30 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register