LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Thread Tools
Old 03-13-2003, 02:50 PM   #1
PhilD
Member
 
Registered: Mar 2003
Location: Iowa, US
Distribution: Gentoo!!, Mandrake 9.1
Posts: 170
Thanked: 0
Question GTK2 - move a borderless window???


[Log in to get rid of this advertisement]
I am new to GTK+ programming and have had very little luck in answering this question. I hope someone here can help.

Okay, this is what I am trying to do:

I am starting by making a simple calendar program using the calendar widget. I want the program to be non-decorated by the window manager. As it is, I am using XFce4 which has a standards compliant WM.

I am currently using: gtk_window_set_decorated(window, FALSE)

This correctly makes the window borderless. However, the compiled and running app can not be moved. Normally I can use <ALT>+Click to drag windows around. I soon found out that the window has to be decorated by the WM for this to work. (at least in my WM)

My question is ? ? ?

Is there a way to get around this, or create a handle in the window container to move the window? I notice that GKrellM is not decorated and can be moved by clicking and dragging at the very top. I have not been able to determine what code is used to do this. How can I make a borderless window movable?

Any and all suggestions, code snips or random statements are welcome.

Thanks,

PhilD
PhilD is offline     Reply With Quote
Old 03-15-2003, 05:55 PM   #2
macewan
Senior Member
 
Registered: Jan 2002
Distribution: Ubuntu, Debian
Posts: 1,053
Thanked: 0
xmms allows for you to suppress the window decorations. it's code might be worth looking at.
macewan is offline     Reply With Quote
Old 03-20-2003, 10:56 PM   #3
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018
Thanked: 0
I don't have any experience with your particular situation, but I would guess that regardless of window decorations, it's up to your window manager to allow movement of the window. (Like you said, it's alt-click for some, or you can grab the titlebar, or similar things).

For apps that have no decorations, you probably need to handle the click event yourself (since your window manager doesn't concern itself with clicks inside the application area). For example, designate some area on your app where you want to be able to "grab" to move it, and look for a mouse-down event there.

Though, once you get a mouse-down, I would have no clue about what code you can use to move the application... I'm not sure if applications are allowed to do that, or if the window manager is supposed to be responsible for it. So I'm afraid I can't be of too much help Maybe this'll give you some ideas though.

Of course, as macewan suggests, check out the source code for other GTK apps that do what you want. That's the beauty of open source!
wapcaplet is offline     Reply With Quote
Old 03-21-2003, 09:31 AM   #4
PhilD
Member
 
Registered: Mar 2003
Location: Iowa, US
Distribution: Gentoo!!, Mandrake 9.1
Posts: 170
Thanked: 0

Original Poster
Thanks for the reply, both of you. I had come up with the mouse-down even, I just haven't found to code to move the window with it. As I mentioned, I looked through GKrellM and had no luck. When I get a break from my work load I am planning on parsing through XMMS.

Thanks for the ideas!!

PhilD
PhilD is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
borderless kde window theme? pyre Linux - General 1 10-26-2004 12:10 PM
Can't move window out of bounds jorisb Linux - Software 3 09-29-2004 08:16 PM
Cannot resize/move firefox window 000jits General 3 09-08-2004 08:39 AM
Am iI a total noob? I Want better window Gui for gtk2 apps when working in gnome!!!!! Samppa72 Linux - Distributions 1 06-07-2004 05:46 PM
Howto move borderless Eterm/aterm rmanocha Linux - Software 3 03-31-2004 01:02 PM


All times are GMT -5. The time now is 11:48 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration