aboutsummaryrefslogtreecommitdiffstats
path: root/sway/main.c
Commit message (Collapse)AuthorAge
* Define _POSIX_C_SOURCE globallyLibravatar Simon Ser2024-02-23
| | | | See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
* Add debug flag to re-enable wl_drmLibravatar Simon Ser2024-01-20
| | | | | | | | | | 7e69a7076fc8 ("Drop wl_drm") has dropped wl_drm, however a lot of software wasn't quite ready for this (Xwayland, libva, amdvlk). Keep wl_drm disabled by default to pressure the wl_drm phase-out, but add a -Dlegacy-wl-drm flag for users to restore the previous behavior in the meantime. References: https://github.com/swaywm/sway/issues/7897
* remove damage debug optionsLibravatar Alexander Orzechowski2024-01-18
| | | | | Now that we use wlr_scene, wlroots handles these. If available use the wlroots debug options instead.
* scene_graph: Use built-in linux dmabuf feedback handlingLibravatar Alexander Orzechowski2024-01-18
|
* Detect Nvidia proprietary driver via drmGetVersion()Libravatar Simon Ser2023-12-12
| | | | | This is less punishing for users with the Nvidia driver loaded but not used by Sway (e.g. for CUDA).
* Drop fglrx detectionLibravatar Simon Ser2023-12-12
| | | | | This ancient driver doesn't do KMS. So we were never able to run with it anyways.
* Pass wl_display to wlr_output_layoutLibravatar Simon Ser2023-11-23
| | | | References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4310
* fix: remove redundant empty statement in main.cLibravatar zkldi2022-07-12
| | | | | This semi-colon looks like a typo. Luckily, it has no effect on the code as it's treated as an empty statement leading the switch case. Really straightforward nitpick change, was just something I was confused by when reading over the code.
* Refuse to start when SUID is detectedLibravatar Kenny Levinsen2022-06-03
| | | | | | | This ensures that those surprised by the deprecation of SUID operation receive an error rather than accidentally having sway run as root. This detection will be removed in a future release.
* realtime: request SCHED_RR using CAP_SYS_NICELibravatar Rouven Czerwinski2022-05-18
| | | | | | | | | | | | | | | | | | | | Try to gain SCHED_RR (round-robin) realtime scheduling privileges before starting the server. This requires CAP_SYS_NICE on Linux systems. We additionally register a pthread_atfork callback which resets the scheduling class back to SCHED_OTHER (the Linux system default). Due to CAP_SYS_NICE, setting RLIMIT_RTPRIO has no effect on the process as documented within man 7 sched (from Linux): Privileged (CAP_SYS_NICE) threads ignore the RLIMIT_RTPRIO limit; as with older kernels, they can make arbitrary changes to scheduling policy and priority. See getrlimit(2) for further information on RLIMIT_RTPRIO Note that this requires the sway distribution packagers to set the CAP_SYS_NICE capability on the sway binary. Supersedes #6992
* sway/main: move constants off the stackLibravatar Manuel Stoeckl2022-03-29
| | | | This makes stack traces from gdb slightly easier to read.
* Use bools for CLI flagsLibravatar Simon Ser2022-01-31
|
* Print deprecation notice when running SUIDLibravatar Kenny Levinsen2022-01-11
| | | | | | | | | | | | | | SUID privilege drop is needed for the "builtin"-backend of libseat, which copied our old "direct" backend behavior for the sake of compatibility and ease of transition. libseat now has a better alternative in the form of seatd-launch. It uses the normal seatd daemon and libseat backend and takes care of SUID for us. Add a soft deprecation warning to highlight our future intent of removing this code. The deprecation cycle is needed to avoid surprises when sway no longer drops privileges.
* sway: allow IPCs on proprietary driversLibravatar Eric Engestrom2021-11-14
| | | | | | | | Proprietary drivers require --unsupported-gpu to be allowed, and IPCs require no option to be passed. The only way to satisfy both is to run IPCs before checking for proprietary drivers.
* Bump RLIMIT_NOFILELibravatar Simon Ser2021-10-30
| | | | | | | | Wayland compositors handle many file descriptors: client connections, DMA-BUFs, sync_files, wl_data_device pipes, and so on. Bump the limit to the max. Closes: https://github.com/swaywm/sway/issues/6285
* Remove --my-next-gpu-wont-be-nvidiaLibravatar Simon Ser2021-10-19
| | | | | | | | | | | | | | | Nvidia has historically been a bad actor in the open-source graphics ecosystem because they required a special EGLStreams code-path instead of exposing the de-facto standard GBM API. However, with their upcoming release they now support GBM as well. This is a push in the right direction for Nvidia, so there's no reason we should be more hostile to them than to any other proprietary driver. Let's remove the --my-next-gpu-wont-be-nvidia flag, and advise users to use --unsupported-gpu now. Note, proprietary Nvidia drivers are still unsupported by the Sway project (just like all other proprietary drivers).
* Add -Dnoscanout debug optionLibravatar Simon Ser2021-09-20
| | | | | | This can help debugging direct scan-out issues, such as [1]. [1]: https://github.com/swaywm/wlroots/issues/3185
* main: removed vc4 detection code.Libravatar Bartłomiej Burdukiewicz2021-04-29
| | | Signed-off-by: Bartłomiej Burdukiewicz <bartlomiej.burdukiewicz@gmail.com>
* Log wlroots version on startupLibravatar Simon Ser2021-04-12
| | | | | | Can be useful to make sure a bugfix is included. In the future maybe the wlroots version string could include a commit hash when built from source, too.
* Make command line option lists constLibravatar Manuel Stoeckl2021-02-04
|
* Changed fprintf(stdout,...) to printf(...) for more readable codeLibravatar SpizzyCoder2021-01-16
|
* Route wlroots logs into Sway logging infrastructureLibravatar Simon Ser2020-12-09
| | | | | | | | | | Instead of letting wlroots print messages to stdout, route debugging messages into Sway's logging functions. This allows a more consistent output (e.g. if Sway or wlroots changes its output style, they don't get out-of-sync). I also added a [wlr] prefix to wlroots messages, not yet sure it's a good thing.
* Handle SIGINTLibravatar Simon Ser2020-08-11
| | | | Gracefully exit on SIGINT, like we do for SIGTERM.
* Log empty value if envvar is not definedLibravatar Antonin Décimo2020-07-30
| | | | | | | If the environment variable is not defined, getenv returns NULL. Passing a NULL pointer to the "%s" format specifier is undefined behavior. Even if some implementations output "(null)", an empty string is nicer.
* Log Sway version on startupLibravatar Simon Ser2020-06-11
|
* config: fix validation exit code and log levelLibravatar Brian Ashworth2020-02-11
| | | | | | | | | This makes it so invalid configs will return the exit code 1 when the validation flag is given. This also reduces the log level to SWAY_ERROR, which makes it so only the errors are shown. If someone wants more verbose output, the can use the -V/--verbose or -d/--debug flags. Additionally, this also makes it so swaybg will not be spawned when validating the config.
* Fix ordering of setgid and setuidLibravatar Teddy Reed2020-02-11
| | | | | | | It looks like the code to drop privileges may have been broken via commit 37f0e1f. That commit reverted the correct order from #911, which first drops the gid then the uid. If setuid is called first then the target user may not have the ability to setgid.
* Fix compiling with -fno-commonLibravatar thermitegod2020-01-24
|
* Fix various memory leaksLibravatar lbonn2019-11-01
| | | | Found with clang-tidy
* Error out on unknown debug flagLibravatar Simon Ser2019-09-22
| | | | | Otehrwise it's pretty easy to misremember a flag and think damage=rerender is enabled when it's not.
* bindings: defer while initiailizingLibravatar Brian Ashworth2019-06-12
| | | | | | | | This adds the logic to defer binding execution while sway is still initializing. Without this, the binding command would be executed, but the command handler would return CMD_DEFER, which was being treated as a failure to run. To avoid partial executions, this will defer all bindings while config->active is false.
* Remove extra inclusion of stdio.hLibravatar Lane Surface2019-04-27
|
* Spawn swaynag as a wayland clientLibravatar Brian Ashworth2019-04-14
| | | | | This spawns swaynag as a wayland client similar to how swaybar and swaybg are already done
* Remove debug treeLibravatar Ryan Dwyer2019-03-18
| | | | This feature has served its purpose. It's better to use IPC now.
* detect_proprietary: use strncmpLibravatar Brian Ashworth2019-03-10
| | | | | Only the main nvidia module needs to be blocked. Others such as nvidiafb are benign and do not need to be blocked
* Minor fix of code duplication.Libravatar hugbubby2019-03-02
| | | | Removes 3~ lines of code that didn't need to be restated.
* run_as_ipc_client: free response after running the IPC commandLibravatar Rouven Czerwinski2019-02-21
| | | | | | | | | | | | Fixes memory leaks in the form of: Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f5f7c2f4f30 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xedf30) #1 0x563c799569f2 in ipc_recv_response ../common/ipc-client.c:94 #2 0x563c79957062 in ipc_single_command ../common/ipc-client.c:138 #3 0x563c798a56cc in run_as_ipc_client ../sway/main.c:127 #4 0x563c798a6a3a in main ../sway/main.c:349 #5 0x7f5f7b4d609a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
* ipc-client: free payload after sending it over the socketLibravatar Rouven Czerwinski2019-02-21
| | | | | | | | | | Fixes memory leaks in the form of: Direct leak of 20 byte(s) in 1 object(s) allocated from: #0 0x7f5f7c2f4f30 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xedf30) #1 0x563c7995b36a in join_args ../common/stringop.c:268 #2 0x563c798a6a1a in main ../sway/main.c:348 #3 0x7f5f7b4d609a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
* Abort early when XDG_RUNTIME_DIR is not setLibravatar Brian Ashworth2019-02-11
| | | | | | This aborts sway and displays an error message about XDG_RUNTIME_DIR not being set without initializing the wl_display or logging any other information.
* Clarify error for options and positional argsLibravatar Brian Ashworth2019-02-06
| | | | | | | | | | | | When both options and positional arguments are given, sway would print the error `Don't use options with the IPC client`. Over the past several months, it seems like users are including this error message in issues instead of a debug log due to not understanding that the error message means there is an issue with their command. This makes the error message more verbose and will hopefully make it so more users understand that the message is not a bug in sway, but with the command used.
* Initialize server so input manager is available.Libravatar Connor E2019-02-05
|
* If validating the config, do it as early as possible.Libravatar Connor E2019-02-05
|
* Cleanup config reading failure error logsLibravatar Brian Ashworth2019-01-29
| | | | | | | | | | | | | | This cleans up the log when sway fails to read a config file. The following changes have been made: - A missing error message has been added to the log when the config file is a directory instead of a regular file - In main, `goto` statements have been added after the `sway_terminate` calls instead of wrapping every block in `if (!terminate_request)` - Unnecessary NULL-checks around calls to free in `main` have been removed - Deferred command execution has been extracted to a separate function and the `Running deferred commands` log message will not be shown when there are no deferred commands.
* Cleanup log_envLibravatar emersion2019-01-28
| | | | | SWAY_CURSOR_* are not used anymore. LD_PRELOAD_PATH doesn't exist and has been replaced with LD_PRELOAD.
* Replace wlr_log with sway_logLibravatar M Stoeckl2019-01-21
| | | | | | | | | | | | | This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
* Do not send ipc_event_shutdown from ipc clientLibravatar Brian Ashworth2019-01-15
| | | | | | In `sway_terminate`, `ipc_event_shutdown` was being sent regardless which mode sway was running in. When running as an ipc client, `sway_terminate` should just exit
* Merge pull request #3144 from emersion/cmd-xwaylandLibravatar Drew DeVault2019-01-13
|\ | | | | Add xwayland command
| * Add xwayland commandLibravatar emersion2018-11-19
| |
* | Remove readline.cLibravatar Ian Fan2019-01-01
| | | | | | | | | | All occurrences of read_line have been replaced by getline. peek_line has been absorbed into detect_brace.
* | Cleanup list codeLibravatar Ian Fan2018-12-09
| |