Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 03-13-2003, 01:50 PM   #1
Registered: Mar 2003
Location: Iowa, US
Distribution: Mint
Posts: 174

Rep: Reputation: 30
Question GTK2 - move a borderless window???

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.


Old 03-15-2003, 04:55 PM   #2
Senior Member
Registered: Jan 2002
Distribution: Ubuntu, Debian
Posts: 1,055
Blog Entries: 1

Rep: Reputation: 45
xmms allows for you to suppress the window decorations. it's code might be worth looking at.
Old 03-20-2003, 09:56 PM   #3
LQ Guru
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
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!
Old 03-21-2003, 08:31 AM   #4
Registered: Mar 2003
Location: Iowa, US
Distribution: Mint
Posts: 174

Original Poster
Rep: Reputation: 30
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!!



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:10 AM
Can't move window out of bounds jorisb Linux - Software 3 09-29-2004 07:16 PM
Cannot resize/move firefox window 000jits General 3 09-08-2004 07: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 04:46 PM
Howto move borderless Eterm/aterm rmanocha Linux - Software 3 03-31-2004 12:02 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:19 AM.

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