diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-11-08 15:48:06 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-11-21 14:03:09 +0000 |
commit | e67e386f1b3432f4697ae61f64150a7f8284c069 (patch) | |
tree | 01b8e3d0437cf2127e978050e383a25a98c8df05 | |
parent | 790a623dd347a1b517e1ff6d71e19df2323753fa (diff) |
Fix typos, whitespace, comments
Fix typos, whitespace, coments
Fix some comments which say "context" when they mean "window", which is
confusing because we have a different data type which is called a "context"
Remove unused set_wm_name_in_context() prototype
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r-- | include/xcwm/context.h | 2 | ||||
-rw-r--r-- | include/xcwm/input.h | 2 | ||||
-rw-r--r-- | include/xcwm/keyboard.h | 2 | ||||
-rw-r--r-- | include/xcwm/window.h | 2 | ||||
-rw-r--r-- | src/libxcwm/Makefile.am | 2 | ||||
-rw-r--r-- | src/libxcwm/atoms.c | 12 | ||||
-rw-r--r-- | src/libxcwm/event_loop.c | 2 | ||||
-rw-r--r-- | src/libxcwm/keyboard.c | 2 | ||||
-rw-r--r-- | src/libxcwm/window.c | 23 | ||||
-rw-r--r-- | src/libxcwm/xcwm_internal.h | 17 |
10 files changed, 29 insertions, 37 deletions
diff --git a/include/xcwm/context.h b/include/xcwm/context.h index ce0fbad..cd135f0 100644 --- a/include/xcwm/context.h +++ b/include/xcwm/context.h @@ -34,7 +34,7 @@ #include <xcb/damage.h> #include <xcb/xcb_icccm.h> -/* Abstract types for context data types +/* Abstract types for context data types * FIXME: Move this to window.h once accessor API functions in place */ struct xcwm_window_t; typedef struct xcwm_window_t xcwm_window_t; diff --git a/include/xcwm/input.h b/include/xcwm/input.h index 31836a2..16d5916 100644 --- a/include/xcwm/input.h +++ b/include/xcwm/input.h @@ -1,6 +1,6 @@ /* Copyright (c) 2012 Jess VanDerwalker <washu@sonic.net> * - * xcwm/event.h + * xcwm/input.h * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/include/xcwm/keyboard.h b/include/xcwm/keyboard.h index a7b97ca..0b8af82 100644 --- a/include/xcwm/keyboard.h +++ b/include/xcwm/keyboard.h @@ -1,6 +1,6 @@ /* Copyright (c) 2012 Apple Inc * - * xcwm/event.h + * xcwm/keyboard.h * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/include/xcwm/window.h b/include/xcwm/window.h index 6f1b98c..39bc3ca 100644 --- a/include/xcwm/window.h +++ b/include/xcwm/window.h @@ -231,7 +231,7 @@ xcwm_window_get_damaged_rect(xcwm_window_t const *window); * Get a copy of the name of the window. Client is responsible for freeing * memory created for the copy. * @param window The window to get name from. - * @return Name of window. + * @return Name of window. */ char * xcwm_window_copy_name(xcwm_window_t const *window); diff --git a/src/libxcwm/Makefile.am b/src/libxcwm/Makefile.am index d2c9e37..116cb0b 100644 --- a/src/libxcwm/Makefile.am +++ b/src/libxcwm/Makefile.am @@ -15,6 +15,6 @@ libxcwm_la_SOURCES = \ init.c \ util.c \ image.c \ - input.c \ + input.c \ atoms.c \ keyboard.c diff --git a/src/libxcwm/atoms.c b/src/libxcwm/atoms.c index 7a98ea6..5a667e8 100644 --- a/src/libxcwm/atoms.c +++ b/src/libxcwm/atoms.c @@ -1,6 +1,6 @@ /* Copyright (c) 2013 Jess VanDerwalker <jvanderw@freedesktop.org> * - * atom.c + * atoms.c * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -123,7 +123,7 @@ _xcwm_atoms_init(xcwm_context_t *context) atom_cookies, &error)) { return error->major_code;; } - + /* Set the _NET_SUPPORTED atom for this context * Most of these are defined as MUSTs in the * EWMH standards for window managers. @@ -308,7 +308,7 @@ _xcwm_atoms_set_wm_delete(xcwm_window_t *window) if (reply.atoms[i] == window->context->atoms->wm_delete_window_atom) { window->wm_delete_set = 1; break; - } + } } } else { window->wm_delete_set = 0; @@ -395,7 +395,7 @@ setup_window_type(xcwm_window_t *window, xcwm_property_t *property) } } } -} +} void set_window_size_hints(xcwm_window_t *window, xcwm_property_t *property) @@ -453,7 +453,7 @@ _xcwm_atoms_set_wm_state(xcwm_window_t *window, xcwm_window_state_t state) ewmh_atom_cnt = 1; icccm_state[0] = XCB_ICCCM_WM_STATE_ICONIC; icccm_state[1] = XCB_NONE; - + ewmh_state = calloc(ewmh_atom_cnt, sizeof(xcb_atom_t)); ewmh_state[0] = window->context->atoms->ewmh_conn._NET_WM_STATE_HIDDEN; break; @@ -483,7 +483,7 @@ _xcwm_atoms_set_wm_state(xcwm_window_t *window, xcwm_window_state_t state) ewmh_state); xcb_flush(window->context->conn); - + if (ewmh_state) { free(ewmh_state); } diff --git a/src/libxcwm/event_loop.c b/src/libxcwm/event_loop.c index 45213b1..ceeda47 100644 --- a/src/libxcwm/event_loop.c +++ b/src/libxcwm/event_loop.c @@ -418,7 +418,7 @@ run_event_loop(void *thread_arg_struct) { xcb_unmap_notify_event_t *notify = (xcb_unmap_notify_event_t *)evt; - + xcwm_window_t *window = _xcwm_window_remove(event_conn, notify->window); diff --git a/src/libxcwm/keyboard.c b/src/libxcwm/keyboard.c index 61185a6..25efa18 100644 --- a/src/libxcwm/keyboard.c +++ b/src/libxcwm/keyboard.c @@ -42,7 +42,7 @@ xcwm_keyboard_set_mapping (xcwm_context_t *context, xcb_void_cookie_t cookie; xcb_generic_error_t *error; - + cookie = xcb_change_keyboard_mapping_checked(context->conn, num_keycodes, first_keycode, diff --git a/src/libxcwm/window.c b/src/libxcwm/window.c index 4f3550c..44121dd 100644 --- a/src/libxcwm/window.c +++ b/src/libxcwm/window.c @@ -39,10 +39,6 @@ void set_window_event_masks(xcb_connection_t *conn, xcwm_window_t *window); -/* Set the WM_NAME property in context */ -void -set_wm_name_in_context(xcb_connection_t *conn, xcwm_window_t *window); - /* Determine values of window WM_SIZE_HINTS */ void set_wm_size_hints_for_window(xcb_connection_t *conn, xcwm_window_t *window); @@ -152,7 +148,7 @@ _xcwm_window_create(xcwm_context_t *context, xcb_window_t new_window, /* register for damage */ init_damage_on_window(context->conn, window); - /* add context to context_list */ + /* add window to window list for this context */ window = _xcwm_add_window(window); /* Set the WM_STATE of the window to normal */ @@ -175,10 +171,10 @@ _xcwm_window_remove(xcb_connection_t *conn, xcb_window_t window) /* Destroy the damage object associated with the window. */ xcb_damage_destroy(conn, removed->damage); - /* Call the remove function in context_list.c */ + /* Remove window from window list for this context */ _xcwm_remove_window_node(removed->window_id); - /* Return the pointer for the context that was removed from the list. */ + /* Return the pointer to the window that was removed from the list. */ return removed; } @@ -239,9 +235,7 @@ xcwm_window_remove_damage(xcwm_window_t *window) void xcwm_window_request_close(xcwm_window_t *window) { - - /* check to see if the context is in the list */ - + /* check to see if the window is in the list */ if (!_xcwm_get_window_node_by_window_id(window->window_id)) return; @@ -557,7 +551,7 @@ void set_window_event_masks(xcb_connection_t *conn, xcwm_window_t *window) { uint32_t values[1] = { XCB_EVENT_MASK_PROPERTY_CHANGE }; - + xcb_change_window_attributes(conn, window->window_id, XCB_CW_EVENT_MASK, values); } @@ -571,8 +565,6 @@ init_damage_on_window(xcb_connection_t *conn, xcwm_window_t *window) damage_id = xcb_generate_id(conn); - // Refer to the Damage Protocol. level = 0 corresponds to the level - // DamageReportRawRectangles. Another level may be more appropriate. level = XCB_DAMAGE_REPORT_LEVEL_BOUNDING_BOX; cookie = xcb_damage_create(conn, damage_id, @@ -584,10 +576,11 @@ init_damage_on_window(xcb_connection_t *conn, xcwm_window_t *window) window->damage = 0; return; } - /* Assign this damage object to the window's context */ + + /* Assign this damage object to the window */ window->damage = damage_id; - /* Set the damage area in the context to zero */ + /* Initialize the damaged area in the window to zero */ window->dmg_bounds->x = 0; window->dmg_bounds->y = 0; window->dmg_bounds->width = 0; diff --git a/src/libxcwm/xcwm_internal.h b/src/libxcwm/xcwm_internal.h index 698a19c..366090d 100644 --- a/src/libxcwm/xcwm_internal.h +++ b/src/libxcwm/xcwm_internal.h @@ -202,7 +202,7 @@ xcwm_window_t * _xcwm_add_window(xcwm_window_t *window); /** - * Remove a context to the context_list using the window's id. + * Remove a window from the context_list using the window's id. * @param window_id The window_id of the window which should * be removed from the context_list */ @@ -210,8 +210,8 @@ void _xcwm_remove_window_node(xcb_window_t window_id); /** - * Find a context in the doubly linked list using its window_id. - * @param window_id The window_id of the context which should + * Find a window in the doubly linked list using its window_id. + * @param window_id The window_id of the window * @return Pointer to window (if found), NULL if not found. */ xcwm_window_t * @@ -222,10 +222,10 @@ _xcwm_get_window_node_by_window_id(xcb_window_t window_id); ****************/ /** - * Create a new context for the window specified in the event. - * @param context The context window was created in. + * Create a new window + * @param context The context the window was created in. * @param new_window ID of the window being created. - * @param parent ID of the new windows parent. + * @param parent ID of the new window's parent. * @return Pointer to new window. NULL if window already exists. */ xcwm_window_t * @@ -236,9 +236,8 @@ _xcwm_window_create(xcwm_context_t *context, xcb_window_t new_window, * Destroy the damage object associated with the window and * remove the window from the list of managed windows. Memory allocated * to the window must be removed with a call to _xcwm_window_release(). - * Call the remove function in context_list.c * @param conn The connection to xserver - * @param event The destroy notify event for the window + * @param window The window being removed * @return Pointer to the window that was removed from the list, NULL if * window isn't being managed */ @@ -292,7 +291,7 @@ void _xcwm_atoms_init_window(xcwm_window_t *window); /** - * Get the set the WM_DELETE_WINDOWatom for the winodw. + * Set the WM_DELETE_WINDOW atom for the window. * @param window The window. */ void |