Commit Graph

2140 Commits

Author SHA1 Message Date
Andreas Kling
ba2e97aa52 LibGUI: Track double-clicking per individual mouse button.
Clicking two separate buttons in quick succession shouldn't be interpreted
as a double click.
2019-04-26 14:15:11 +02:00
Andreas Kling
d4a8e2930e sh: Add a simple "export" command for setting environment variables. 2019-04-26 03:23:27 +02:00
Andreas Kling
490e89e240 LibC: Add execvpe() and make execvp()'ed children inherit environment. 2019-04-26 03:16:26 +02:00
Andreas Kling
0a68e0046f LibCore: Make it possible to create a CFile for an existing file descriptor. 2019-04-26 02:22:21 +02:00
Andreas Kling
c392c0d799 Userland: Add a simple /bin/tr program. 2019-04-26 00:57:37 +02:00
Andreas Kling
671dee9afa Userland: Add a simple /bin/sort program. 2019-04-26 00:53:57 +02:00
Andreas Kling
b5a1ee1d3e Userland: Add a simple /bin/head program. 2019-04-26 00:47:30 +02:00
Andreas Kling
8effdc807a LibC: Update stdio stream error state in more places. 2019-04-26 00:41:37 +02:00
Andreas Kling
1163e0a030 Kernel: Don't count kfree(nullptr) as a call to kfree().
This was causing the kmalloc/kfree call delta to accumulate errors.
2019-04-25 23:18:11 +02:00
Andreas Kling
96d4b701e6 sh: Make "cd" jump to the home directory. And also let's set $HOME.
Nobody else is setting $HOME right now, so we might as well do it here.
This should eventually be done by some sort of "login" program.
2019-04-25 23:09:21 +02:00
Andreas Kling
89e9aafbb5 sh: Support erasing a whole word with WERASE (^W). 2019-04-25 23:05:10 +02:00
Andreas Kling
71770e000b GTextEditor: Add very basic automatic indentation.
This is off by default, but enabled by TextEditor. It simply inserts the
same number of leading spaces as the previous line when hitting Enter. :^)
2019-04-25 22:56:09 +02:00
Andreas Kling
8a3d00ac02 GTableView: Double-click should only activate/edit valid indices. 2019-04-25 22:55:44 +02:00
Andreas Kling
e2e2c78332 GTextEditor: Double-clicking on a word should select that word. 2019-04-25 22:29:25 +02:00
Andreas Kling
44673c4f3b Kernel: Add a write cache to DiskBackedFS.
This way you can spam small write()s on a file without the kernel writing
to disk every single time. Flushes are included in the FS::sync() operation
and will get triggered regularly by syncd. :^)
2019-04-25 22:05:53 +02:00
Andreas Kling
e0cdc5db0d Ext2FS: Reduce debug spam in block allocation. 2019-04-25 22:05:32 +02:00
Andreas Kling
de4b77ef27 WindowServer: Ignore title change notifications for non-normal windows. 2019-04-25 17:38:16 +02:00
Andreas Kling
04b7def6ab sh: Add support for redirecting stdin and stdout with < and >.
This is certainly about time. The kernel has had all the necessary support
in place for months, and I just kept postponing working on the shell. :^)
2019-04-25 16:10:16 +02:00
Andreas Kling
df8e76a67c cat: Just use fd 0 when no arguments are passed.
I'm not sure why it seemed necessary at some point to open /dev/stdin rather
than simply using the already-open fd 0.
2019-04-25 16:01:28 +02:00
Andreas Kling
6c950f8f83 Kernel: Dump stack trace when kmalloc() fails. 2019-04-25 15:58:49 +02:00
Andreas Kling
e84faadb63 sh: Refactor command parsing into a separate class. 2019-04-25 14:34:25 +02:00
Andreas Kling
07de1147ad sh: Add basic command piping support. 2019-04-25 14:13:36 +02:00
Andreas Kling
aa84e2fc64 fgrep: Don't repeat old incoming data if fgets() failed. 2019-04-25 14:07:17 +02:00
Andreas Kling
d5578826af Kernel: Make it possible to look up FIFO's by ID.
This will be useful when implementing the /proc/PID/fd/N links where N is
a file descriptor referring to a FIFO.
2019-04-25 13:53:24 +02:00
Andreas Kling
eadcf720c0 Userland: Add a simple /bin/echo program. 2019-04-25 04:42:09 +02:00
Andreas Kling
737315c228 GTextEditor: Improve cursor positioning accuracy when using a mouse.
Put the cursor on the left or right side of a glyph when clicking it based
on distance to middle of glyphs. This is such an obvious change that makes
a small but noticeable difference in feel. :^)
2019-04-25 02:15:45 +02:00
Andreas Kling
7a5525edf4 GTextEditor: Go a little past the cursor for Home/End scroll-into-view.
When jumping to the start of a line, or to the end of a line, scrolling two
pixels past the end yields a pleasant effect.
2019-04-25 01:33:59 +02:00
Andreas Kling
2c51bc92af GTextEditor: Always call did_change() before set_cursor().
This is not very obvious and I need to come up with a better design, but for
now just make sure to call did_change() before calling set_cursor().
This is needed because set_cursor() will try to scroll the cursor into view,
and for right-aligned text, did_change() may change the content rect which
needs to be reflected by the time we call scroll_cursor_into_view().
2019-04-25 01:28:17 +02:00
Andreas Kling
4e715dbc71 GTextEditor: Account for the GFrame border in the painting code.
We were forgetting to translate the painter by the frame_thickness().
With this fixed, we can also do proper vertical centering of lines for
single-line editors, and things suddenly look nicer than ever! :^)
2019-04-25 01:11:35 +02:00
Andreas Kling
3543236e8f GScrollableWidget: The visible_content_rect() should be max content_size().
When computing the visible content rect, constrain the result to the content
size. The content shouldn't feel responsible for painting anything outside.
2019-04-25 00:05:48 +02:00
Andreas Kling
7dc4078a73 SharedGraphics: Add is_right_text_alignment(TextAlignment) helper.
This seems a tad bit more future-proof than manually checking all the valid
right-side TextAlignment values in clients.
2019-04-24 23:46:19 +02:00
Andreas Kling
0c88ce9ee3 GTextEditor: Expand the content "to-fill" for right aligned text.
When using a right-side text alignment, hook the resize event to make sure
that the content width is at least frame_inner_rect().width() wide.

This allows us to use content_width() as the anchor point for right aligned
text, rather than using the frame inner rect, which was clearly wrong in
the overflow case.
2019-04-24 23:42:49 +02:00
Andreas Kling
f1eba2295d GTextEditor: Make the line_widget_rect() span the widget horizontally. 2019-04-24 23:15:15 +02:00
Andreas Kling
4bea3a4aa6 GTextEditor: Turn off the ruler by default.
You're usually not gonna want the ruler. TextEditor can enable it manually.
2019-04-24 23:06:44 +02:00
Andreas Kling
5c240af3f7 GTextEditor: Fix line_content_rect() behavior with custom alignments. 2019-04-24 22:46:27 +02:00
Andreas Kling
62f0aae4ca GTextEditor: Add support for different text alignments.
Currently only CenterLeft and CenterRight are supported, but it would be
very straightforward to add other alignments as well.
2019-04-24 22:24:16 +02:00
Andreas Kling
16f6a3af3c Allow passing extra args to qemu via a SERENITY_EXTRA_QEMU_ARGS env var. 2019-04-24 21:06:16 +02:00
Andreas Kling
16cbfd3f4e Taskbar: Clicking a window button now toggles minimized state. 2019-04-24 02:48:02 +02:00
Andreas Kling
d7cf841d3d Kernel: Add a comment block about the Device class. 2019-04-24 02:37:57 +02:00
Andreas Kling
f7a23f3668 Taskbar: Forgot to add WindowIdentifier.h. 2019-04-24 02:20:38 +02:00
Andreas Kling
ca9ed13643 Kernel: Simplify Device::open(). 2019-04-24 02:20:14 +02:00
Andreas Kling
c1b310c5bf Build: Let's skip the --gc-sections linker option for now. 2019-04-24 01:57:51 +02:00
Andreas Kling
956bd23aae WindowServer+TaskBar: Add a taskbar window button popup menu.
This patch only hooks up the minimize and unminimize actions.
2019-04-23 23:14:14 +02:00
Andreas Kling
c5c4e54a67 Kernel: Process destruction should destroy all child threads.
We were only destroying the main thread when a process died, leaving any
secondary threads around. They couldn't run, but because they were still
in the global thread list, strange things could happen since they had some
now-stale pointers to their old process.
2019-04-23 22:17:01 +02:00
Andreas Kling
e2cd572e60 WindowServer: Add some padding to the window switcher items. 2019-04-23 22:01:33 +02:00
Andreas Kling
0c898e3c2c Put assertions behind a DEBUG flag to make it easy to build without them. 2019-04-23 21:52:02 +02:00
Andreas Kling
f3754b8429 Build: Pass --gc-sections to the linker in all builds.
This removes unused sections from the output and reduces the binary size
of everything we compile.
2019-04-23 21:37:10 +02:00
Andreas Kling
f042b3adeb Kernel: Make the right shift key work.
I never realized the right shift key wasn't hooked up since my left pinky
always hovers over the left shift key, ready to rock.
2019-04-23 20:47:45 +02:00
Andreas Kling
f520d87097 WindowServer: Remove debug spam about activating non-normal windows. 2019-04-23 20:46:10 +02:00
Andreas Kling
02e5d55832 LibGUI: Don't bother setting a title on tooltip windows. 2019-04-23 20:45:42 +02:00