summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-11-21Adopt existing windows at startupJon TURNEY1-0/+56
The helps when testing changes to a libxcwm-based WM, as you don't need to restart the clients to see the effect. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-11-21Fix parameter transposition in xcwm_window_configure()Jon TURNEY2-4/+4
xcwm_window_configure() has width and height parameters in the opposite order to the order used everywhere else. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-11-21Remove unused x,y parameters to xcwm_input_mouse_button_event()Jon TURNEY2-7/+2
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-11-21Remove unused button parameter to xcwm_input_mouse_motion()Jon TURNEY2-3/+2
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-11-21Report an error, rather than just segfaulting, if the X server can't be ↵Jon TURNEY1-0/+5
contacted Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-11-21Fix a use after free of return_evtJon TURNEY1-1/+1
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-11-21Update xcb_ewmh_set_supporting_wm_check() for and require xcb-util-wm 0.3.9Jon TURNEY1-1/+5
xcb-util-wm commit 23a4eb6059e0a694e342c3ff41ab076dad50b745, present in 0.3.9, changes the xcb_ewmh_set_supporting_wm_check() API. Update for that and require xcb-util-wm 0.3.9 Use the updated xcb_ewmh_set_supporting_wm_check() to more correctly implement EWMH, setting the _NET_SUPPORTING_WM_CHECK property on the root *and* child window. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-11-21Clean up a mention of xtoq in libxcwmJon TURNEY1-3/+3
Also, make debug output for injected input events a bit clearer Also, add button number to xcwm_input_mouse_button_event debug output Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-11-21Fix a lingering XTOQ in an include guard in libxcwmJon TURNEY1-3/+3
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-11-02Link libxcwm with -no-undefined libtool flagJon TURNEY1-1/+1
"Use -no-undefined to assure libtool that the library has no unresolved symbols at link time, so that libtool will build a shared library on platforms that require that all symbols are resolved when the library is linked." Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-29libxcwm: Removing initial damage on override-redirect window.Jess VanDerwalker1-11/+43
The initial damage event for override-redirect windows are reported relative to screen, not window. This initial damage is removed, and then the whole window is marked as damaged (using window relative coordinates). Override-redirect can also report damage events with an incorrect height. This case is treated the same as the initial damage event. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-29libxcwm: keyboard.h/.c created for keymapping functions.Jess VanDerwalker2-1/+85
Created keyboard.h/.c which contain functions for setting keyboard mapping and modifier mapping. Added these files to the build process. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-29libxcwm: Building and setting modifier keymap.Jess VanDerwalker1-7/+90
Modifer keymap is built in XtoQBuildModifierMaps() taking advantage of existing logic to determine keysyms in key map. Call to xcb_set_modifier_mapping() added to set mapping of modifiers. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-29libxcwm: Setting _NET_WM_STATE_HIDDEN on iconic windows.Jess VanDerwalker3-10/+49
Added xcwm_window_state_t enum for the window states supported by library. _xcwm_atoms_set_wm_state() updated to use xcwm_window_state_t as param. Also, _xcwm_atoms_set_wm_state sets the _NET_WM_STATE atom to _NET_WM_STATE_HIDDEN when window is made iconic, and removes it when window is de-iconified. Signed-off-by: Jess VanDerwalker <washu@sonic.net>
2012-08-29xtoq: Handlers for window miniaturization and de-miniaturization.Jess VanDerwalker2-0/+39
Handlers added for Xtoq window miniaturization (iconify) and de-miniaturization (de-iconify). Calls xcwm_window_iconify() and xcwm_window_deiconify() to update window state. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-29libxcwm: Functions in atoms.c and window.c for setting of ICCCM WM_STATE atom.Jess VanDerwalker3-1/+60
A wm_state_atom field added to xcwm_atoms_t and value determined on atom init. Functions to change state to Iconic or Normal added to window.c and atoms.c. Functions in window.c are wrappers for the atoms.c functions. The window.c functions are to be called by window manager when window is iconified or de-iconified. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-29libxcwm, xtoq: Handlers for window name change event.Jess VanDerwalker5-11/+66
In libxcwm, WM_NAME atom retrieved and added to the xcwm_atoms_t structure for context. _xcwm_atoms_set_window_name() now checks _NET_WM_NAME first, before WM_NAME. XCWM_EVENT_WINDOW_NAME event added to enum. In event loop, event of type XCB_PROPERTY_NOTIFY is checked to see if atom matches _NET_WM_NAME or WM_NAME. If so, event sent to xtoq. Function to handle update to window name added to XtoqController.m and case for XCWM_EVENT_WINDOW_NAME added to eventHandler(). Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-29libxcwm: Setting window type based on EWMH _NET_WM_WINDOW_TYPEJess VanDerwalker1-22/+82
ICCCM WM_TRANSIENT_FOR atoms is checked, and if set, window is set to XCWM_WINDOW_TYPE_DIALOG, otherwise XCWM_WINDOW_TYPE_NORMAL. Then the EWMH _NET_WINDOW_TYPE atoms is checked, if set, type is determined from its value - otherwise previous value is used. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-29libxcwm: Removed keysym cruft from previous testing.Jess VanDerwalker1-6/+0
Removed a call to xcb_key_symbols_alloc() that serves no purpose. Believe left over from test code that has since been removed. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddlestone Seqouia <jeremyhu@apple.com>
2012-08-29libxcwm: Creating window for EWMH compliant window manager.Jess VanDerwalker2-6/+70
Creating a window that is never mapped, but has name of EWMH compliant window manager and has _NET_SUPPORTING_WM_CHECK set to its ID on both itself and the root window. As specified in the EWMH spec: http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#id2577320 _xcwm_atoms_init now returns 0 on success, or XCB error code if atom initialization fails or if another EWMH compliant window manager is running. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddlestone Sequoia <jeremyhu@apple.com>
2012-08-29libxcwm: Initializing and setting supported EWMH atoms for connection.Jess VanDerwalker5-20/+69
Initializing of EWMH atoms done through xcb_ewmh_init_atoms() and xcb_ewmh_init_atoms_replies(). This populates a structure, xcb_ewmh_connection_t with the values for all EWMH atoms and the WM_PROTOCOLS atom. xcb_ewmh_connection_t added to xcwm_wm_atoms_t, and wm_protocols_atom removed. Value for the connection's screen added to xcwm_context_t, as it is used in initializing xcb_ewmh_connection_t. Added _xcwm_atoms_release() to handle cleaning up the xcb_ewmh_connection_t in context. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddlestone Seqouia <jeremyhu@apple.com>
2012-08-29libxcwm: atoms.c created for ICCCM functions.Jess VanDerwalker7-167/+231
Created an atoms.c file to hold functions that deal with initializing and getting and setting data from ICCCM atoms. Moved functions from window.c and init.c that handle ICCCM atoms into this file. atoms.c added to Makefile.am Removed global xcwm_wm_atoms_t _wm_atoms variable and placed in xcwm_context_t as xcwm_context_t *atoms. Updated references so they now point to context->atoms. Allocation memory for struct in context initalization and freeing in xcwm_context_close(). Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddlestone Seqouia <jeremyhu@apple.com>
2012-07-26xtoq: NSFlagsChanged case added to XtoqApplication sendEvent()Jess VanDerwalker2-3/+49
Press and release of modifier keys are not passed by NSKeyUp or NSKeyDown events, but in NSFlagsChanged. Added an NSFlagsChanged case to the sendEvent switch. The modifier flags of the event are checked against the current set of modifier flags to determine if the modifier key, as specified in the event's keyCode, has been pressed or released. Keycode is then sent on to keyUp/DownInView handler. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-26xtoq: Properly setting offset of window by height of Mac window bar.Jess VanDerwalker1-1/+1
The position of the window on the X server was being set incorrectly, creating a difference in positions between OS X window position and X server position. Signed-off-by: Jess VanDerwalker <washu@sonic.net>
2012-07-26libxcwm: Configure requests for unmanaged windows accepted.Jess VanDerwalker3-30/+21
The configure requests for unmanaged windows are passed on and accepted with a call to xcb_configure_window in _xcwm_resize_window. Added x and y position information to _xcwm_resize_window and its call to xcb_configure_window. Signed-off-by: Jess VanDerwalker <washu@sonic.net>
2012-07-26libxcwm: Propery change notification for WM_DELETE handled.Jess VanDerwalker3-6/+45
Windows may set WM_DELETE after being mapped, so XCB_EVENT_MASK_PROPERTY_CHANGE event mask set on all newly created windows so we can get notification. XCB_PROPERTY_NOTIFY case added to event loop to catch propery change events. In window.c set_wm_delete_win_in_context changed to _xcwm_window_set_wm_delete as it is now a function that is called across modules. XCB_PROPERTY_NOTIFY handles case where WM_PROTOCOLS has changed, then calls _xcwm_window_set_wm_delete to determine if WM_DELETE atom has changed. Signed-off-by: Jess VanDerwalker <washu@sonic.net>
2012-07-26libxcwm: Fix for build fail do to missing paren.Jess VanDerwalker1-6/+4
Missing paren was in memset statement for window sizing struct. Removed memset statement, moved memory allocation for xcwm_window_t sizing to xcwm_window_create() and changed to calloc to 0 fill xcwm_sizing_t structure. Properly freeing memory for window sizing struct in xcwm_window_release. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25xtoq: Support for window sizing restrictions added.Jess VanDerwalker1-0/+15
On window creation, XtoQ gets the sizing data for the window and sets the resizing increments, max size, and min size of the window. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25libxcwm: Using strlen() to get length of atom names.Jess VanDerwalker1-2/+3
Calls to get atoms were previously using preset numbers. strlen guards against atom name and length getting out of sync. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25libxcwm: Support for WM_TRANSIENT_FOR and WM_SIZE_HINTS addedJess VanDerwalker2-45/+96
Getting values of ICCCM properties has been changed to use the xcb_icccm.h functions available to simplify library code. On receiving a mapping event, WM_TRANSIENT_FOR and WM_SIZE_HINTS for window are checked for the window, and values in xcwm_window_t are set. Enumeration added for different EWMH window types, currently only XCWM_WINDOW_TYPE_DIALOG and XCWM_WINDOW_TYPE_NORMAL are used. A xcwm_sizing_t structure was added to hold WM_SIZE_HINT data for the window. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25xtoq: Standalone keymap application.Jess VanDerwalker4-28/+101
Added keymap_main.c to function as driver for keymap.c code. main in keymap_main.c takes display to connect to on command line, opens connection and passes the connection on to the keymap.c code through XtoQKeymapReSync. Added build target to src/xtoq/Makefile.am to build stand alone application. In keymap.c, XtoQKeymapReSync and XtoQKeyboardReloadHandler now take xcb_connection_t as parameter. XtoQKeyboardReloadHandler uses call to xcb_change_keyboard_mapping_checked to send keyymap with proper keysyms to X server. References to KeySyms changed to xcb_keysym_t for compatibility with xcb_change_keyboard_mapping_checked. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25libxcwm: Replaced event type defines with enum.Jess VanDerwalker2-19/+11
Also removed xcwm_context_t from xcwm_event_t and accessor functions. Context available through window. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25libxcwm: The root context's root window's context set to root context.Jess VanDerwalker1-0/+2
Awkward circular assignment, but it addresses issue where window manager client may ask for the xcwm_context_t of the root window. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25xtoq: Support for override-redirect windows added.Jess VanDerwalker1-5/+18
On window creation, XtoQ checks xcwm_window_is_override_redirect() and if it returns true, creates window with no decorations. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25libxcwm: Support for override-redirect window mapping and unmappingJess VanDerwalker3-37/+121
Creation of override-redirect windows are done through XCB_MAP_NOTIFY, and removal through XCB_UNMAP_NOTIFY so cases for these events have been added to event_loop.c::run_event_loop.c Override_redirect and inital_damage flags added to xcwm_window_t struct. _xcwm_window_created changed present tense _xcwm_window_create. Check of window attributes sets override_redirect and initial_damage flags to "1" if window is determined to be override-redirect. Accessor function xcwm_window_is_override_redirect() added to allow window manager to determine if window is/isn't an override-redirect window. _xcwm_destroy_window generalized to _xcwm_window_remove which is called by XCB_UNMAP_NOTIFY and XCB_DESTROY_NOTIFY events. Alteration to handing damage event to in event_loop.c::run_event_loop(). Initial damage events to override-redirect windows are reported relative to the root window - not relative to the window itself. The "initial_damage" and "override_redirect" flags in xcwm_window_t is used to determine if the damage event is the first damage event for an override-redirect window. If this is the case, the coordinates of the damage area of the window are translated to window relative coordinates before the event is passed on to the window manager client. This allows the client to grab the correct window pixmap when it calls xcwm_image_copy_damaged(). Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25xtoq: Commented out code that kills X server.Jess VanDerwalker1-12/+13
Commented out the code that kills the X server, since it is using a sledgehammer approach that kills *every* running instance of Xorg. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25xtoq: Error fixed in translation of X server to OS X coordinates.Jess VanDerwalker1-1/+1
Fixed error in translation of X server coordinates to OS X coordinates. Windows were being reported at incorect positions. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25xtoq: NS*MouseDragged event cases added to sendEvent()Jess VanDerwalker1-1/+3
Added NS*MouseDragged event cases to sendEvent() in same case as NSMouseMoved so mouse movements during drags are reported to X server like NSMouseMoved events. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25libxcwm: Comment and printf changes in event_loop.cJess VanDerwalker1-6/+4
Changed the comments and removed/commented out printfs for XCB_CONFIGURE_NOTIFY and XCB_MOTION_NOTIFY cases in run_event_loop(). Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25libxcwm: xcwm_image_copy_full not using correct coordinates.Jess VanDerwalker1-2/+2
Because xcwm_image_copy_full retrevies the window image in window relative coordinates, x & y should be 0. Was using the root relative x,y. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-05-30libxcwm, xtoq: Checks for valid window image added.Jess VanDerwalker3-10/+20
xcwm_image_copy_* return NULL if call to xcb_image_get fails to return a valid image. xcwm_image_copy_damaged returns NULL if damage area has no width or height. Checks for NULL image added to XtoqView draw. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-25Memory for window freed in _xcwm_window_release.Jess VanDerwalker4-37/+51
Memory for the window allocated by library is freed in _xcwm_window_release, which is called after the client has done any clean up it needs to do on its side. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-25Accessor functions for xcwm_context_t and xcwm_window_tJess VanDerwalker6-81/+168
Both xcwm_context_t and xcwm_window_t have accessor functions for fields that client may need access to. Changed xtoq code to refer to struct fields through the accessor functions. Added xcwm_rect_t struct to hold information for window and window damage areas. Created xcwm_rect_t to hold geometry information for windows and damage areas. This structure is not opaque. Asserts added were memory for window and window rects allocated. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23*.h and *.c files for input, window, context, and image.Jess VanDerwalker13-218/+220
Also prefixed public input.c, image.c and window.c functions with xcwm_input_*, xcwm_window_* and xcwm_image_*. Fixed some remaining issues with functions that were requiring both a context and window. Renamed data.h to context.h and xcwm.c to context.c - placed code in context, window, and image. Added image.c and context.c to Makefile.am. Removed data.h from project and references to it. The struct definitions previously in data.h have been moved into other files. Renamed xcwm_image_get_* to xcwm_image_copy_*. Changed calls in xtoq code to new function names. Definition of xcwm_window_t moved to window.h Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-06xcwm_context_t added to xcwm_window_t struct.Jess VanDerwalker10-68/+56
The xcwm_window_t now holds the xcwm_context_t that its associated with. Changed functions that required a window and a context to only take a window. Signed-off-by: Jess VanDerwalker <washu@sonic.net>
2012-04-05Merge branch 'jess'Jeremy Huddleston18-653/+693
Conflicts: include/xcwm/xtoq.h src/libxcwm/context_list.c src/libxcwm/event_loop.c src/libxcwm/init.c src/libxcwm/input.c src/libxcwm/window.c src/libxcwm/xcwm.c src/libxcwm/xcwm_internal.h src/xtoq/XtoqApplication.h src/xtoq/XtoqApplication.m src/xtoq/XtoqController.h src/xtoq/XtoqController.m src/xtoq/XtoqImageRep.m src/xtoq/XtoqView.h src/xtoq/XtoqView.m src/xtoq/XtoqWindow.h src/xtoq/XtoqWindow.m Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-05Separate xcwm_context_t into two types, a context and a windowJess VanDerwalker14-299/+352
xcwm_context_t is now broken into xcwm_context_t which holds connection data, and xcwm_window_t which holds window specific data. Signed-off-by: Jess VanDerwalker <washu@sonic.net>
2012-04-05Key up and down events rolled into one handler.Jess VanDerwalker2-20/+17
xcwm_input_key_pressed and xcwm_input_key_released compressed into xcwm_input_key_event with state parameter to determine if key has been pressed or released. Signed-off-by: Jess VanDerwalker <washu@sonic.net>
2012-04-05Mouse button press and release rolled into one function.Jess VanDerwalker4-34/+33
xcwm_input_button_pressed and xcwm_input_button_released compressed into one function - xcwm_input_mouse_button_event that takes a state parameter to determine if mouse button has been pressed or released. Signed-off-by: Jess VanDerwalker <washu@sonic.net>
2012-04-05Namespaced input functions and removed window parameter.Jess VanDerwalker2-34/+29
Input functions are not prefixed with xcwm_input_*. Also removed the Mac window ID that was being passed into input functions for debugging purposes. Signed-off-by: Jess VanDerwalker <washu@sonic.net>