Ordering windows on the desktop



I am experiencing some trouble with multiple windows opened up by my
app. For example, here is a snippet. When I run this, two windows show
up. Everything is okay.

But if I obscure the 'parent' window by bringing up another app (one
that covers the entire desktop.. my browser for example), the parent
window behaves and gets out of the way. But the child window stays on
top and shows up in front of my browser.

What I need is for the 'child' window to behave just like the parent.
Get out of the way if another app is taking up the desktop.

The funny thing is, the following piece of code does what I want to do
on my WinXP env. The child window gets out of the way. But on my linux
env , the child window always stays on top.

Most likely this has nothing to do with the perl bindings themselves.
But if some one has ideas on what I am running into, that'll be great.

Regards,

_Ofey

# -------------------------------- #
use strict;
use warnings;
use Glib qw(TRUE FALSE);
use Gtk2 qw/-init/;
use Data::Dumper;

my $window = Gtk2::Window->new;
$window->signal_connect('destroy', sub { Gtk2->main_quit; });
$window->add(Gtk2::Label->new('parent'));
$window->set_default_size(300, 300);
$window->show_all;

my $childwindow = Gtk2::Window->new('toplevel');
$childwindow->set_decorated(0);
$childwindow->set_type_hint('GDK_WINDOW_TYPE_HINT_DOCK');
$childwindow->set_transient_for($window);
$childwindow->modify_bg ('normal', Gtk2::Gdk::Color->parse('red'));
$childwindow->add(Gtk2::Label->new('child'));
$childwindow->show_all;
$childwindow->set_default_size(100, 300);
$childwindow->move(100, 100);

Gtk2->main;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]