GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reserve space on desktop

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
Zarg
Familiar Face


Joined: 09 Mar 2008
Posts: 14

PostPosted: Sun Mar 09, 2008 2:46 pm    Post subject: Reserve space on desktop Reply with quote

Hello everybody!

I'm writing my first GTK-Application and actually everything is running as it should ...
But now I'd like to reserve some space of the desktop for my application, like the gnome-panel and many docks do, so that my window will not be overlapped by maximised applications. Unfortunately I couldn't find a solution :(

I'd be glad for any help, thanks.

Zarg
Back to top
caracal
GTK+ Geek


Joined: 21 Jun 2007
Posts: 90
Location: Wilkes Barre Pa

PostPosted: Tue Mar 11, 2008 3:27 am    Post subject: Reply with quote

You need to use gdk to do that.

Example:
---------------------
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_type_hint(GTK_WINDOW(window),GDK_WINDOW_TYPE_HINT_DOCK);


These are hints for the window manager that indicate what type of function the window has. The window manager can use this when determining decoration and behaviour of the window. The hint must be set before mapping the window.
----------------------
GDK_WINDOW_TYPE_HINT_NORMAL Normal toplevel window.
GDK_WINDOW_TYPE_HINT_DIALOG Dialog window.
GDK_WINDOW_TYPE_HINT_MENU Window used to implement a menu; GTK+ uses this hint only for torn-off menus, see GtkTearoffMenuItem.
GDK_WINDOW_TYPE_HINT_TOOLBAR Window used to implement toolbars.
GDK_WINDOW_TYPE_HINT_SPLASHSCREEN Window used to display a splash screen during application startup.
GDK_WINDOW_TYPE_HINT_UTILITY Utility windows which are not detached toolbars or dialogs.
GDK_WINDOW_TYPE_HINT_DOCK Used for creating dock or panel windows.
GDK_WINDOW_TYPE_HINT_DESKTOP Used for creating the desktop background window.
GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU A menu that belongs to a menubar.
GDK_WINDOW_TYPE_HINT_POPUP_MENU A menu that does not belong to a menubar, e.g. a context menu.
GDK_WINDOW_TYPE_HINT_TOOLTIP A tooltip.
GDK_WINDOW_TYPE_HINT_NOTIFICATION A notification - typically a "bubble" that belongs to a status icon.
GDK_WINDOW_TYPE_HINT_COMBO A popup from a combo box.
GDK_WINDOW_TYPE_HINT_DND A window that is used to implement a DND cursor.

http://library.gnome.org/devel/gdk/2.13/gdk-Windows.html#GdkWindowTypeHint

Hope that helps :)
Back to top
Zarg
Familiar Face


Joined: 09 Mar 2008
Posts: 14

PostPosted: Tue Mar 11, 2008 7:56 am    Post subject: Reply with quote

Hello caracal!

Thank you for your answer!

Unfortunately this didn't help me: I already changed the window type to dock and it docks my window to the corner of the screen, it makes it impossible for my application to get focus, but it does not prevent maximised windows from overlapping my docked window (actually the maximised windows are under my window to be precise).

Any other suggestions? I really have no clue on how to solve this problem and would be happy about every little advice, thanks :-)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP