Dana Jansens [Sun, 27 Jun 2010 17:46:47 +0000 (13:46 -0400)]
draw the root pixmap, and bind the glxpixmap to the texture only once
NOTE: derek please check my use of glTexEnvi (it seems to be working but idk)
root pixmap comes from _XROOTPMAP_ID and ESETROOT_PMAP_ID
the glxpixmap only needs to be bound to the texture once after the glxpixmap
is created, so do that rather than every time we draw the texture.
added create_glx_pixmap(), bind_glx_pixmap(), and destroy_glx_pixmap()
functions in composite.c to help wth this process
added a "bound" variable to ObWindow that tracks if the glxpixmap was
successfully bound to the texture, so when we destroy the glxpixmap, we can
tell if we should unbind/release it from the texture
Dana Jansens [Sun, 27 Jun 2010 11:27:14 +0000 (13:27 +0200)]
Redraw the screen when a ObWindow is destroyed, but not on every related event
We won't get an event we recognize is a window if we destroy the window
(such as a MenuFrame going away), as the event will no longer be tracable
to that window.
Also don't redraw on every map/unmap/configurenotify we see, just ones for
the top-level windows.
Dana Jansens [Sat, 26 Jun 2010 00:01:03 +0000 (02:01 +0200)]
Fix stacking of unmanaged windows and managing windows on restart.
keep inputonly windows in the stacking order
create hashtables in stacking.[ch] to find windows in the stacking lists by
their window id
make the screen support window be an obwindow since it is a child of root
and so windows can stack relative to it.
allow unmanaged windows to change their stacking order and track the changes
for display
on restart manage unmapped windows as "unmanaged" as well as override-redirect
windows (the code paths here changed a fair bit, allowing fewer repetitive
XGetWindowAttributes calls)
adds a ObStackingIter data structure and functions in stacking.[ch] that allow
you to iterate through all the windows (managed and unmanaged) together in
the order they should appear on screen.
Dana Jansens [Fri, 25 Jun 2010 16:42:12 +0000 (18:42 +0200)]
Fix restart and unmanaging windows in composite
When restarting, catch unmapped windows as ObUnmanaged objects
When unmanaging a client, ignore the ReparentNotify to root, rather than
thinking the unmanaged window is now embedded somewhere
Also add some ob_debug's for unmanaged event handling
Dana Jansens [Fri, 25 Jun 2010 12:57:19 +0000 (14:57 +0200)]
Add shape support to the composite code.
Keeps the window's shape in an array of XRectangles in the ObWindow.
Also, moved the event handlers that are handled for ObWindows rather than
subclasses into a function event_handle_window(). The function returns a
bool saying it the event can also be handled by others or should be treated
as finished.
Dana Jansens [Fri, 25 Jun 2010 11:04:18 +0000 (13:04 +0200)]
Allow ObWindow subclasses to redirect a child window of the top-level window
This means ObClient redirects the client window itself, rather than the
parenting frame window.
Added a "toparea" to the ObWindow that tracks the top-level window's area,
so the "area" can track the redirected window's area inside the top-level
window.
Added window_set_top_area() that must be called before window_set_abstract()
for subclasses of ObWindow. This sets the initial position/size/border of
ObWindow's top-most window, that will be given in window_set_abstract().
After that, it can track any changes made to the window's geometry on its
own.
Decor is now invisible since it needs to be drawn by the Compositing code
explicitly.
Dana Jansens [Fri, 11 Jun 2010 18:38:56 +0000 (14:38 -0400)]
Make composite code more reliable and correct.
use glXDestroyPixmap not glXDestroyGLXPixmap (since we use glXCreatePixmap)
send a client message after taking the composite selection.
allow others to take the composite selection and disable our compositing gracefully, destroying our selection window.
start composite before anything that will create an ObWindow
Dana Jansens [Fri, 11 Jun 2010 16:11:44 +0000 (12:11 -0400)]
Clean up the composite stuff a bunch.
Fix a bunch of memory leaks.
Clean up composite.h to only have things that are needed externally right now (can add more back later as needed)
Don't use a singleton struct to hold all the composite things
Shutdown cleanly so Xorg radeon driver doesn't crash
Release resources when composite fails to init
Dana Jansens [Thu, 10 Jun 2010 18:17:18 +0000 (14:17 -0400)]
Specify the GLX_TEXTURE_TARGET_EXT when creating a glXPixmap
This is a workaround for non-spec drivers. See issue #4 here: http://www.opengl.org/registry/specs/EXT/texture_from_pixmap.txt
A default should be chosen, but it is not. We assume that GL_ARB_texture_non_power_of_two is present for now, and just always ask for a GL_TEXTURE_2D texture
Dana Jansens [Thu, 10 Jun 2010 14:44:11 +0000 (10:44 -0400)]
choose an fbconfig without double buffer, and with smallest stencil/depth buffer possible (to save mem?)
also, save the fbconfig's texture format rather than assuming it is RGBA
Dana Jansens [Wed, 9 Jun 2010 23:08:31 +0000 (19:08 -0400)]
Rework ObWindow for better inheritence.
add window_new() that allocates an ObWindow (also works for a subclass)
add window_free() that frees it.
add window_set_abstract() that a subclass must call to set up the ObWindow's
"abstract class" functionality
add abstract properties in ObWindow: depth, top, layer.
make all the existing ObWindows use the new window_foo() functions.
Dana Jansens [Mon, 14 Jun 2010 16:15:02 +0000 (12:15 -0400)]
Fix the EXTENTS reported on window frames.
Change the order things are done on map, so we apply startup state without
any states set first, thus getting all the functions possible for the window
type etc. then change the order states are applied, as some remove the
ability to apply others (ie fullscreen comes last).
Add an oldsize to ObFrame that remembers the size of the frame last reported to
the world through the EXTENTS property. If you frame_adjust_area(FAKE) then
frame_adjust_area(NONFAKE), the EXTENTS would not be updated since the
oldsize wasn't remembered across fake updates.
Make the extentsrequest test ask about windows with states set also.
Dana Jansens [Thu, 3 Jun 2010 16:10:54 +0000 (12:10 -0400)]
improved .desktop parsing.
properly (and quickly) check for existence of required keys
figure out what an app can open from its exec key
validate the %fields in an app's exec key
Dana Jansens [Fri, 21 May 2010 20:51:45 +0000 (16:51 -0400)]
allow new windows on other desktops to get focused if specified in a per-app rule
you can not client_active() with user=false and desktop=true and activate things on other desktops, by the general focus steal restrictions, if you wanted to do that sorta thing