Commit graph

588 commits

Author SHA1 Message Date
Penaz
b7891cddf4 Merge branch 'main' into moredocs 2026-04-09 22:15:46 +02:00
Jack Tench
2c18bcbf5e
Ensure dialog windows can only have one instance open (#356)
* Convert help dialog to singleton

* Convert settings dialog to singleton
2026-04-09 10:46:14 -03:00
Daniele Penazzo
3a4f3e0563
Save context menu pointer in window (#351)
Previously the menu was regenerated and the old pointer never freed,
leading to a memory leak.

Fixes #350
2026-03-29 18:29:33 -03:00
Daniele Penazzo
3dbf761487
Address Scan build Warnings (#344)
* Add guard in maps.c to avoid NULL-dereferencing

* Remove dead-store in bind.c

It's assigned in the for loop anyway and never read outside of it.

* Remove dead-store in theming.c

We assign the error flag and then never read from it again.

* Remove dead-store in prev-segment.c

It's assigned in the if statement 3 lines below, and never read outside
of it.

* Move GSList declaration inside for loop

* Address GCC's complaints about missing va_end()s

* Address possible failure in callocating error_msg
2026-03-28 20:25:04 -03:00
Pedro Montes Alcalde
8a288e9eab
actions: Fix possible nullptr dereference when opening a file dialog (#349) 2026-03-28 18:01:34 -03:00
Daniele Penazzo
3c07a9a25f
Make sure dialogs at least try to find a parent window (#343)
* Make sure dialogs at least try to find a parent window

Given when they're viewed, the only active window should be the main
window from LibreSplit. If push comes to shove, we can change the code
to iterate through all windows until we find one that is "marked" as the
main window.

Fixes #261

* Autoimporter stuff
2026-03-27 20:17:42 -03:00
Pedro Montes Alcalde
cf7399b7fb
timer: Fix game & timer leaks (#330) 2026-03-10 15:53:05 -03:00
Daniele Penazzo
0ec65fdee5
Added customized logging library (#317)
* Added asynchronous logging library

Did some rudimentary testing, might need more for safety.

Fixes #316 at least in part

* Included missing stdbool include

* Added console logging (in addition to file logging)

* Force a file flush at every write

This might be useful if we want to analyze the cause of a crash, if we
don't flush the file, one to several log lines might be missing.

* Added default log settings for release and debug versions

* Added LOG_*F formattable logging functions

* Allow the main thread to close the logger

Or LS will keep on logging from a detached thread.

* Empty the logger queue on thread exit.

This should remove the possibility of losing messages on exit.

* Add timestamps to logs and avoid double newlines

* Put the log file in XDG_DATA_DIR/libresplit

* Default LogLevel at Warns + Errors

Debug LogLevel stays at "everything"

* Bunch'o'statics

* Move prctl to the beginning of the logging thread code
2026-03-10 19:49:17 +01:00
Daniele Penazzo
c4fd163e54
Fix various memory issues (#334)
* Properly free the splits icon paths on game release

This fixes a small memory leak when you load/unload/reload splits with
icons

* Correctly free stuff in the splits component too

* Fix two segfaults when timer is not loaded

A check is missing for the presence of timer, so if you right click ->
close and then try to open a split or auto splitter, libresplit
segfaults.

* Correctly free welcome_box on closing

* Make sure that malloc() in gui_settings actually works

In low-memory conditions the malloc may fail with undefined behaviour

* Revert connection of destroy signal

The widget is freed just before LibreSplit closes already. I thought it
was a disconnected signal handler.

* Autoimporter mon amour (non)

* Actually this one isn't needed anymore
2026-03-10 19:48:38 +01:00
Pedro Montes Alcalde
a29f3ba34c
timer: Overhaul the logic and callings (#290)
* meow

* miao

* :3

* aaaaaaa

* cheese

* bbbbbbbbb

* blehhhhhh

* miao

* :D

* nyan

* small

* splits

* last tick fix

* maybe

* hehe

* docstrings

* docs change

* Fix segfault on no splits

* remove asserts

* Dont run reset when not running

* actually reset this time i swear

* avoid reset desync

* suggestions

* meow

* miao

* format nyaaaa
2026-03-02 14:58:45 -03:00
Penaz
ddb25745d4 Merge branch 'main' into moredocs 2026-02-25 21:17:30 +01:00
Daniele Penazzo
c34bd39ef0
Fix compiler failure on certain systems (#311)
In my system (and others) initializing a char* with strchr might turn up
as an error (in those cases the signature is `const char* strchr` instead of `char* strchr`).

Some sources say the signatures differ when the first argument is const,
others don't. This should fix the compilation issue at least.
2026-02-25 11:58:50 -03:00
Daniele Penazzo
3e94856963
Str2ida functionality (#313)
* Added rough str2ida implementation

* Added small documentation.

* Move the lua pushed string to the heap

Works with compilers that don't support VLA and avoids
stack-overflow-induced headaches.

* Check if malloc actually mallocs
2026-02-18 21:00:47 -03:00
Pedro Montes Alcalde
a52ea9dd84
maps: Clear previous map name (#307) 2026-02-16 18:31:35 -03:00
Pedro Montes Alcalde
917f61cbc2
appimage: Fix icon search path (#295) 2026-02-16 12:12:32 -03:00
Daniele Penazzo
7faf65eadd
Add missing settings in documentation (#305)
* Add missing settings in documentation

* Replace single quotes with double quotes
2026-02-16 12:08:26 -03:00
Daniele Penazzo
db4524233f
Fix possible segfault if no type is defined. (#304)
* Fix possible segfault if no type is defined.

The type of value to read is a mandatory argument, skipping directly to
the address (`readAddress(0x...)`) will lead to a segfault

* Fix possible segfault on calls without arguments

Just to be safe.
2026-02-15 20:43:50 -03:00
EXtremeExploit
bdec42523c
ci: Fix nightly permissions
Some checks failed
/ Build (push) Has been cancelled
/ format-check (push) Has been cancelled
/ linter-check (push) Has been cancelled
/ Upload nightly release (push) Has been cancelled
2026-02-14 11:36:32 -03:00
Pedro Montes Alcalde
0ec416e092
ci: Add nightly releases (#264) 2026-02-14 11:21:45 -03:00
Jack Tench
f87a6829c9
Standardise parent window parameter of dialogs (#299)
Some checks failed
/ Build (push) Has been cancelled
/ format-check (push) Has been cancelled
/ linter-check (push) Has been cancelled
/ Build AppImage (push) Has been cancelled
2026-02-11 17:24:12 -03:00
Daniele Penazzo
7ccddc0062
Added clickable "clear icons" on Entry Widgets in settings (#296)
* Added basic keypress unbind icon

And made it work for string options too, cause it's handy

* Added missing docstrings
2026-02-11 17:06:26 -03:00
Penaz
56c8e6cdc6 Added docs to delayed callbacks 2026-02-09 21:46:54 +01:00
Penaz
e163b1a320 Added missing welcome box docs 2026-02-09 21:40:07 +01:00
Penaz
087a077978 Added missing docs for variables and fallback CSS 2026-02-09 21:36:51 +01:00
Penaz
2ee43f972e Added missing struct docstring 2026-02-09 21:34:01 +01:00
Penaz
22d3af4d63 Added docstrings to settings dialog. 2026-02-09 21:31:59 +01:00
Penaz
caf32bfc75 Added docs to help_window 2026-02-09 21:24:12 +01:00
Penaz
529951beba Added missing docstrings to dialogs.c 2026-02-09 21:19:02 +01:00
Penaz
7934753ac0 Added missing docstrings in app_window.c 2026-02-09 21:11:50 +01:00
Penaz
65bbb4ef51 Added some documentation for LSSplits component 2026-02-09 20:38:29 +01:00
Daniele Penazzo
7d86e7c329
Split modules v3 (#282)
* Split declarations and definitions for windows

* Exploded the program

* Fix formatting
2026-02-08 16:18:09 -03:00
Jack Tench
df1a2dc99f
Update linting workflow to use older c standard (#289)
* Update linting workflow to use older c standard

* Add int types to bind.c

* Run clang-format to move include
2026-02-08 12:58:55 -03:00
Jack Tench
ea31fa07e3
Add optional runtime deps to readme (#288) 2026-02-08 11:38:33 -03:00
Pedro Montes Alcalde
490d3987b5
Lower C standard from gnu23 to gnu17 (#283) 2026-02-08 11:38:02 -03:00
MxCraven
74669ebdf9
Update timer images in readme (#273)
* Update timer images in readme

* 45 percent width images
2026-02-05 11:39:29 -03:00
Daniele Penazzo
8b96ab1a2e
Reset rules (#281)
* Added main-window class

Seems that editing the `.window` class affects all windows in
LibreSplit, which is definitely unwanted.

Left the note in the CSS classes for posterity.

* Added another note on LibreSplit/GTK's theming capabilities

* Added a reset stylesheet as string

Theoretically, if it works as it should should fix both #272 and #63

* Applied suggestions and fixes

* Changed function signature and error handling

* Pointer Confusion

This shows the error in case of bad reset rules, tested by stepping with
GDB
2026-02-04 18:38:52 -03:00
Daniele Penazzo
26f87c8ea3
Added settings to allow user to disable alerts for gold and worse run (#280)
Fixes #275
2026-02-04 14:58:24 -03:00
Daniele Penazzo
844ec16bc4
Keygrabber for Keybinds (#269)
* Keygrabber for Keybinds

Very useful.

Fixes #265

* Documentation, fixes and reformatting

The auto importer strikes again.
2026-02-03 18:23:47 -03:00
Daniele Penazzo
7a861aa2da
Delayed keybind handlers support (#262)
* Fix segfault on first start

If no split_file is defined, there will be a NULL-point dereference,
leading to a segfault. This fixes that.

* First idea of "delayed keybind handlers"

* Trying to make the structure more reusable

Not sure it worked.

* Added missing pragma
2026-02-03 16:53:28 -03:00
MxCraven
79a8fb159c
Fill out descriptions of themes.md (#263)
* Fill out descriptions of themes.md

Some are self explanitory, but I got confused by a lot while making a theme so I thought I'd try and add something to everything.

* Update themes.md

From review from penaz
2026-02-03 15:37:31 -03:00
Daniele Penazzo
8ddee5b731
Fix segfault on first start (#258)
If no split_file is defined, there will be a NULL-point dereference,
leading to a segfault. This fixes that.
2026-02-01 21:39:49 -03:00
Daniele Penazzo
4990a4f911
Add option to enable/disable run history saving (#257)
* Add save run history setting definition

* Save only when relative option is active

Fixes #255
2026-01-30 17:19:41 -03:00
Daniele Penazzo
d703856d9b
Added types to splits docs (#256) 2026-01-30 17:18:40 -03:00
Pedro Montes Alcalde
a75c5d4ef2
timer: Fix saving worse time (#217) 2026-01-30 11:08:53 -03:00
Jack Tench
1f1b0db3fd
Fix timer not resetting in non-gold runs (#254)
Bug introduced in #253
2026-01-29 20:36:36 -03:00
Daniele Penazzo
eff5ba287c
Disallow changing splits or autosplitter if a run is on (#252)
* Disallow changing splits or autosplitter if a run is on

Fixes #241

* Define external function to see if a run is started

Uses the RTA timer "running" property and the atomic_bool run_started
from the Auto splitter

* Replace or statement with relative descriptive function

* Use is_run_started for autosplitter warnings too
2026-01-29 20:32:42 -03:00
Jack Tench
58fefe904e
Prompt user when resetting a run with a gold split (#253)
* Create confirm reset dialog

* Add detection logic for a gold in the current run

* Prompt for confirmation when run has a gold split

* Switch to using stdbool

* Move reset logic to not interfere with other logic
2026-01-29 20:32:07 -03:00
Pedro Montes Alcalde
4dd11944ec
settings: Use const when possible (#235) 2026-01-27 09:48:45 -03:00
Pedro Montes Alcalde
cafb713024
gui: Dont show any digits when number of digits is 0 (#249) 2026-01-27 09:48:10 -03:00
Pedro Montes Alcalde
a9459cfa4a
gui: Close other windows when main window is closed (#250) 2026-01-27 09:47:49 -03:00