Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create a window without borders and without headline? (Xlib)

1,176 views
Skip to first unread message

Roland Fuchs

unread,
Mar 31, 1998, 3:00:00 AM3/31/98
to

Hi,
I need in my application one window, that can use the whole screen
without borders, header, footer. If I create a window as xlib call (
XCreateWindow / XCreateSimpleWindow ) , I get a window with header and
border, even with the border_width - attribute set to 0 (flagmask is
correctly set).
Does someone know, which attributes are used to create a window
without headline, borders, resize corners ....
Xlib? XToolkit? XView prefered ...!

THX,
Roland.
--
CAUTION: Stop junk mails - remove all 'w' you can see!

Raghavan V Parthasarathy

unread,
Apr 1, 1998, 3:00:00 AM4/1/98
to

I think there is a attribute called override_redirect
attribute in the XsetWindowAttributes structure .set it to True
and you will get only a plain window

Regards
Raghavan V.P

Dan A. Mercer

unread,
Apr 1, 1998, 3:00:00 AM4/1/98
to

Roland Fuchs (Roland...@wwwshs-online.de) wrote:
: Hi,
: I need in my application one window, that can use the whole screen
: without borders, header, footer. If I create a window as xlib call (
: XCreateWindow / XCreateSimpleWindow ) , I get a window with header and
: border, even with the border_width - attribute set to 0 (flagmask is
: correctly set).
: Does someone know, which attributes are used to create a window
: without headline, borders, resize corners ....
: Xlib? XToolkit? XView prefered ...!

: THX,
: Roland.
: --
: CAUTION: Stop junk mails - remove all 'w' you can see!

The borders, header etc are a separate window that contains your window.
The frame window is applied and controlled by the window manager. To
remove the window, you must tell the window manager. If the
window manager is a motif window manager (mwm, vuewm, dtwm) and
the client is a motif client (dtterm, for instance) setting
the mwmDecorations resource to "none" (0) works. For instance:

dtterm -xrm '*mwmDecorations: 0'

If the client is not a Motif client, like xterm, this will not
work. However, in this case you must instruct the window manager
directly via the clientDecoration resource (note, mwmDecorations is plural
and clientDecoration is singular). For instance:

in the Vuewm resource definition file:

Vuewm*MyIcons*clientDecoration: none

I would be interested in more details on your application and why it
needs the whole screen. Perhaps you don't even need a window manager.

--
Dan Mercer
Reply To: dame...@mmm.com

Opinions expressed herein are my own and may not represent those of my employer.


Roland+Juliane Fuchs

unread,
Apr 2, 1998, 3:00:00 AM4/2/98
to

On 1 Apr 1998 15:29:18 GMT, dame...@mmm.com (Dan A. Mercer) wrote:

>I would be interested in more details on your application and why it
>needs the whole screen. Perhaps you don't even need a window manager.

Hi Dan,
my application is used as a Testpattern generator to test special B&W
Monitors at resolution 2160x2560. I want to write patterns like grid,
single points, and Grayscale regions from corner 0,0 to max_x, max_y
(if possible ... )
Without grayscale, only Black and White patterns, I use the
"override_redirect" flag set true ( XVIEW: FRAME_TOP_LEVEL_NO_DECOR =
TRUE). This works fine. But in case of grayscale patterns, I need my
own Colormap installed. And with "override_redirect set true, the
windowmanager disables switching colormaps for my application.
I think, I have to install Colormaps in my appl. manually with
XInstallColormap ....

THX a lot,
Roland.
--
CAUTION: Stop junk mail! Remove all 'w' you can see!

Roland+Juliane Fuchs

unread,
Apr 2, 1998, 3:00:00 AM4/2/98
to

On Wed, 01 Apr 1998 09:54:45 +0900, Raghavan V Parthasarathy
<ragh...@snow.bmc.com> wrote:

> I think there is a attribute called override_redirect
> attribute in the XsetWindowAttributes structure .set it to True
>and you will get only a plain window

With "override_redirect set true, the


windowmanager disables switching colormaps for my application.
I think, I have to install Colormaps in my appl. manually with

XInstallColormap .... (because I need my own grayscale colormap ).

Martin Shepherd

unread,
Apr 4, 1998, 3:00:00 AM4/4/98
to

Juliane...@wwwsplit.uni-bamberg.de (Roland+Juliane Fuchs) writes:
> On 1 Apr 1998 15:29:18 GMT, dame...@mmm.com (Dan A. Mercer) wrote:
> >I would be interested in more details on your application and why it
> >needs the whole screen. Perhaps you don't even need a window manager.
>
> Hi Dan,
> my application is used as a Testpattern generator to test special B&W
> Monitors at resolution 2160x2560. I want to write patterns like grid,
> single points, and Grayscale regions from corner 0,0 to max_x, max_y
> (if possible ... )

If you don't care about portability across window managers, there is a
way to do this that doesn't require the removal of window-manager
decorations. Some window managers allow you to create windows that are
bigger than the size of the screen. I use olvwm, which (unlike olwm)
supports this. I would guess that any window manager that supports a
virtual desktop will also allow windows to exceed the size of the
desktop, but I haven't verified this.

The following example code shows one way to exploit this:

-----------------------------------------------------------------------
Display *display; /* The display that hosts the new window */
Screen *screen; /* The target screen of the display */
Window window, child; /* The new window */
XWindowAttributes attr; /* The attributes of the new window */
int x, y; /* The initial root-window coordinates of */
/* the window. */
/*
* Open a connection to the X server, using the display named in your
* DISPLAY environment variable.
*/
display = XOpenDisplay("");
if(!display)
error("Unable to open display.");
/*
* Get the primary screen of the display.
*/
screen = ScreenOfDisplay(display,0);
/*
* Create the new window.
*/
window = XCreateSimpleWindow(display, RootWindowOfScreen(screen),
0, 0, WidthOfScreen(screen), HeightOfScreen(screen),
0, BlackPixelOfScreen(screen), WhitePixelOfScreen(screen));
/*
* Tell the window manager to display the window.
*/
XMapWindow(display, window);
/*
* Find out where it placed the window.
*/
if(XGetWindowAttributes(display, window, &attr) == 0)
error("XGetWindowAttributes failed.");
/*
* Convert attr.x and attr.y from parent-relative coordinates to
* root-window coordinates.
*/
XTranslateCoordinates(display, window, attr.root, 0, 0, &x, &y, &child);
/*
* Move the top-left corner of the window to root-window position (0,0).
* Note that this is the top-left corner of your window, not that of
* any enclosing decoration window, so if your window manager allows
* this, the unwanted margins will be moved off the edge of the screen.
*/
XMoveWindow(display, window, -x, -y);
/*
* Update the display.
*/
XFlush(display);
-----------------------------------------------------------------------

Note that WidthOfScreen() and HeightOfScreen() etc.. are standard Xlib
macros.

I have tried this code with olvwm and it works as intended.

Martin Shepherd (m...@astro.caltech.edu)

Roland Fuchs

unread,
Apr 6, 1998, 3:00:00 AM4/6/98
to

Martin,

thanks a lot for your answer with code example. I try it in next days,


Roland.
--
CAUTION: Stop junk mails - remove all 'w' you can see!

0 new messages