So, I'm just having some fun here trying to make a window dragable without a frame. Basically, I came up with this simple little technique that actually works, but it's buggy. I can't identify exactly what causes window to go crazy all over the screen and then fly off somewhere.
{"name":"601614","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/5\/0530a1dd5f460554bbb00a122c097603.png","w":1200,"h":900,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/5\/0530a1dd5f460554bbb00a122c097603"}
I'm surprised it works as well as it does, but it doesn't retain the position of the mouse inside the window (as well as sometimes just flipping out all together.) In the screenshot, the window has been dragged around a bit and you'll notice the red cross hair (drag start) and green cross hair (current mouse position) have different locations. The actual mouse cursor is not visible in the screenshot. This isn't a regular transformation - sometimes they'll still overlap when dragging, and sometimes they won't. Sometimes the window will flip out on a drag with slow mouse movement, other times it's with quick mouse movements.
I tried some other methods like setting al_set_mouse_xy() to the same mouse position when the drag began, but that would only aggravate the window flip outs more. Don't know why.
Here's a complete example (with a few extra lines of code that aren't used) if you wanna try it out. I've attached an MSVC build for Windows, too. Click-drag to drag the window. Press an any key to quit. You may have to hard-close it if it flies off the screen.
Did you look at how ex_noframe does it? It seems to work quite well at least under Linux. [edit: yours doesn't seem to work at all in linux, on the other hand]
Did you look at how ex_noframe does it?
oooahhhmmmmm... let's see...
al_get_mouse_cursor_position();
I was looking for a function that did that... I was so close.
[edit]Any chance we'll get support for a frameless window with an alpha channel?
Any chance we'll get support for a frameless window with an alpha channel?
Yes, I want that. I think in the API we basically support it already, just nobody has sent a patch implementing it for any platform yet.
As far as the flip-outs go, my best guess would be when you move the window, more mouse movement events are fired, giving you wonky coordinates, causing it to go apeshit.
A frameless window with alpha would be nice, as I've set my base gui to allow for rectangular, triangular, and circular/elliptical windows but have only implemented the rectangular at the moment.
WG
Any chance we'll get support for a frameless window with an alpha channel?
Only with the caveat that we may not be able to provide that functionality on all supported platforms (I don't think we can, someone correct me if I'm wrong).
Probably work on Mac, Windows, and Linux, I imagine.
Should be easy for Linux/X11 (if supported by your window manager, which is probably only the case with a compositing window manager... but who is still using something else). We won't provide it for ios4 of course since even with the added multi-tasking it's one app at the screen at a time. I have no idea about Windows or OSX.
Probably work on Mac
That'll depend on the version of OS X that is running, I imagine.
I have no idea about Windows or OSX
I'm sure it can be done in Windows. I remember almost 10 years ago I did figured it out, and that was in Visual Basic.
I'm sure it can be done in Windows. I remember almost 10 years ago I did figured it out, and that was in Visual Basic.
Back then it was more likely just a window mask rather than an alpha channel.
True. I remember it being 1 or 0 transparency.