From owner-oi-users Wed Mar 15 15:35:17 1995 Return-Path: oi-users-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id PAA01632 for oi-users-outgoing; Wed, 15 Mar 1995 15:35:17 -0800 Received: from marvin.boulder.openware.com (marvin.boulder.openware.com [192.245.99.138]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id PAA01626 for ; Wed, 15 Mar 1995 15:35:11 -0800 Received: from boulder.openware.com (localhost.boulder.parcplace.com [127.0.0.1]) by marvin.boulder.openware.com (8.6.9/8.6.9) with ESMTP id QAA04570; Wed, 15 Mar 1995 16:32:19 -0700 Message-Id: <199503152332.QAA04570@marvin.boulder.openware.com> To: David Ngai Subject: Re: Bringing a window to the top. Cc: oi-users@freefall.cdrom.com In-reply-to: Your message of Wed, 15 Mar 1995 15:34:16 EST Date: Wed, 15 Mar 1995 16:32:16 MST From: Warner Losh Sender: oi-users-owner@FreeBSD.org Precedence: bulk : Does anybody know a way to make an obscurred window : rise to the top? : : or to "always" stay on top? Well, in general, you don't want to do this because you are fighting with the window manager. However, if you want to pick that fight, here's how :-) Basically, you put a visibility notify on the outside X window, and when it becomes obscured, you raise that window. This is from a program I wrote where 'top' is an override redirect window (think toolbar menu), but it should work with non-override redirect windows as well. void raise_me( const XEvent *ep, void *argp ) { if (ep->xany.type == VisibilityNotify && ep->xvisibility.state != VisibilityUnobscured) XRaiseWindow( ((OI_d_tech *) argp)->display(), ((OI_d_tech *)argp)->outside_X_window()); } int main( int argc, char ** argv ) { // ... top = oi_create_box( "top", 1, 1 ); cp->dispatch_insert( top->outside_X_window(), VisibilityNotify, VisibilityChangeMask, &raise_me, (void *) top ); // ... } Warner