aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
AgeCommit message (Collapse)Author
2018-08-26Remove layout.cRyan Dwyer
When we have type safety we'll need to have functions for workspace_add_tiling and so on. This means the existing container functions will be just for containers, so they are being moved to container.c. At this point layout.c doesn't contain much else, so I've relocated everything and removed the file. * container_swap and its static functions have been moved to the swap command and made static. * container_recursive_resize has been moved to the resize command and made static. * The following have been moved to container.c: * container_handle_fullscreen_reparent * container_insert_child * container_add_sibling * container_add_child * container_remove_child * container_replace_child * container_split * enum movement_direction and sway_dir_to_wlr have been moved to util.c. Side note: Several commands included layout.h which then included root.h. With layout.h gone, root.h has to be included by those commands.
2018-08-18Implement iterators per container typeRyan Dwyer
This introduces the following `for_each` functions: * root_for_each_workspace * root_for_each_container * output_for_each_workspace * output_for_each_container * workspace_for_each_container And introduces the following `find` functions: * root_find_output * root_find_workspace * root_find_container * output_find_workspace * output_find_container * workspace_find_container * container_find_child And removes the following functions: * container_descendants * container_for_each_descendant * container_find This change is preparing the way for demoting sway_container. Eventually these functions will accept and return sway_outputs, sway_workspaces and sway_containers (meaning a C_CONTAINER or C_VIEW). This change also makes it easy to handle abnormalities like the workspace floating list, root's scratchpad list and (once implemented) root's saved workspaces list for when there's no connected outputs.
2018-08-11Remove container_for_each_descendant_bfsRyan Dwyer
The function was not used. Also renames container_for_each_descendant_dfs to just container_for_each_descendant.
2018-08-03Remove swaynag_clone and use memcpyBrian Ashworth
2018-08-03Write to swaynag pipe fd directly on config errorsBrian Ashworth
2018-08-03Show swaynag on config errorsBrian Ashworth
2018-07-24Implement floating_modifier <mod> [inverse|normal]Brian Ashworth
2018-07-24Merge pull request #2165 from swaywm/pid-workspacesDrew DeVault
Implement pid->workspace tracking
2018-07-23Parse mouse binding optionsfrsfnrrg
First, the existing sway_binding structure is given an enumerated type code. As all flags to bindsym/bindcode are boolean, a single uint32 is used to hold all flags. The _BORDER, _CONTENTS, _TITLEBAR flags, when active, indicate in which part of a container the binding can trigger; to localize complexity, they do not overlap with the command line arguments, which center around _TITLEBAR being set by default. The keyboard handling code is adjusted for this change, as is binding_key_compare; note that BINDING_LOCKED is *not* part of the key portion of the binding. Next, list of mouse bindings is introduced and cleaned up. Finally, the binding command parsing code is extended to handle the case where bindsym is used to describe a mouse binding rather than a keysym binding; the difference between the two may be detected as late as when the first key/button is parsed, or as early as the first flag. As bindings can have multiple keycodes/keysyms/buttons, mixed keysym/button sequences are prohibited.
2018-07-23Merge branch 'master' into pid-workspacesDrew DeVault
2018-07-20Reset outputs on reloadBrian Ashworth
2018-07-21Implement force_display_urgency_hintRyan Dwyer
The directive sets the timeout before an urgent view becomes normal again after switching to it from another workspace. Also: * When an xwayland surface removes the urgent hint while the timer is active, we now ignore the request. This happens as soon as the view receives focus, so it was effectively making the timer pointless. * The timeout is now only applied when switching to it from another workspace.
2018-07-19Fix deferred command handlingBrian Ashworth
2018-07-17Free individual criteria in free_configfrsfnrrg
Also free cmd_list when cleaning up a struct criteria.
2018-07-16Revert "config: free include path on successful load"Drew DeVault
This reverts commit 92450883d7b148d408b42c3553a60340a14771f6.
2018-07-15config: free include path on successful loadIan Fan
2018-07-15Add error handling for getting config file sizeIan Fan
2018-07-15Fix config buffer overflow and logicIan Fan
2018-07-14Simplify transactions by utilising a dirty flag on containersRyan Dwyer
This PR changes the way we handle transactions to a more simple method. The new method is to mark containers as dirty from low level code (eg. arranging, or container_destroy, and eventually seat_set_focus), then call transaction_commit_dirty which picks up those containers and runs them through a transaction. The old methods of using transactions (arrange_and_commit, or creating one manually) are now no longer possible. The highest-level code (execute_command and view implementation handlers) will call transaction_commit_dirty, so most other code just needs to set containers as dirty. This is done by arranging, but can also be done by calling container_set_dirty.
2018-07-12config.c: fix current_config uninit warning (#2249)Alex Xu
2018-07-10Add get_config message type to ipcIan Fan
2018-07-09Update for swaywm/wlroots#1126emersion
2018-07-05config: add a couple of forgotten freesDominique Martinet
2018-07-02load_config: move NULL path check before first useDominique Martinet
Found through static analysis
2018-07-02config include: fix leak on relative include pathDominique Martinet
Found through static analysis
2018-07-02read_config: fix leak on errorDominique Martinet
Found through static analysis.
2018-07-01Implement pid->workspace trackingDrew DeVault
When you spawn a process with the exec command, sway now notes the workspace you had focused and the pid of the child process, then assigns that workspace to the child when its window appears. Some of this is carried over from sway 0.15, but with some major refactoring and centralization of state.
2018-06-09Refactor everything that needs to arrange windowsRyan Dwyer
* The arrange_foo functions are now replaced with arrange_and_commit, or with manually created transactions and arrange_windows x2. * The arrange functions are now only called from the highest level functions rather than from both high level and low level functions. * Due to the previous point, view_set_fullscreen_raw and view_set_fullscreen are both merged into one function again. * Floating and fullscreen are now working with transactions.
2018-06-07Remove strip quoting and fix strncpy-overlapBrian Ashworth
2018-06-05Fix logic issue in do_var_replacementBrian Ashworth
2018-06-05Support runtime var expansion and set at runtimeBrian Ashworth
2018-06-03sway/config: fix use-after-free for end of blockDominique Martinet
Introduced in 7c810dc344c28d1876c5ee158cb0806289d0f813
2018-06-02Address first round of review for generic blocksBrian Ashworth
2018-06-02Support braces on next line for config blocksBrian Ashworth
2018-06-02Make command block implementation genericBrian Ashworth
2018-06-01Fix crash when using multiple outputsRyan Dwyer
2018-06-01Consider floating views when calculating title heightRyan Dwyer
2018-05-27Implement focus_wrappingBrian Ashworth
2018-05-13Idle handling for dpms/lockscreen et alMattias Eriksson
Swayidle handles idle events and allows for dpms and lockscreen handling. It also handles systemd sleep events, and can raise a lockscreen on sleep Fixes #541
2018-05-10Use reasonable default for font heightRyan Dwyer
Fixes #1949
2018-05-05Move code for re-arranging after font height change into a common placeRyan Dwyer
2018-05-03Fix unfocused.text defaultDrew DeVault
2018-05-03Convert border_colors.text to float[4]Drew DeVault
2018-05-03Calculate config->font_height based on existing container titlesRyan Dwyer
2018-05-03Render titlesRyan Dwyer
2018-05-01Remove unnecessary pointersRyan Dwyer
2018-04-30Implement bordersRyan Dwyer
Implements rendering of borders. Title text is still to do. Implements the following configuration directives: * client.focused * client.focused_inactive * client.unfocused * client.urgent * border * default_border
2018-04-02rename seat functionsTony Crisci
2018-03-31Implement focus_follows_mouseDrew DeVault
Also contains two other small changes: - Clicking any button will focus the container clicked (not just left) - Remove seamless_mouse (doesn't make sense on wlroots)
2018-03-31Free bar configs on reload and exitDrew DeVault