Commit Graph

1578 Commits

Author SHA1 Message Date
Andreas Kling
1030e6b848 FileManager: Add a "Location:" label. 2019-03-20 22:01:02 +01:00
Andreas Kling
86e2348b74 Kernel+LibC: Don't crash upon traversal of large directories. 2019-03-20 18:31:12 +01:00
Andreas Kling
7b32afdcfc Kernel: Oops, forgot to add Alarm.h earlier. Here it is. 2019-03-20 18:16:15 +01:00
Andreas Kling
f0915641c5 TextEditor: Add "delete" action. 2019-03-20 18:16:04 +01:00
Andreas Kling
daa1dcb5e8 FileManager: Use a GTextEditor for the location bar + tweak icons. 2019-03-20 18:12:56 +01:00
Andreas Kling
367bb9e4eb Kernel: Remove ioctl for getting a socket peer's PID.
Now that everything is nice and mature, the WindowServer can just use the
client PID it receives in the Greeting message, and we can get rid of this
hacky ioctl. :^)
2019-03-20 17:14:48 +01:00
Andreas Kling
bc1da7f1fd Kernel: Snooze the NetworkTask until there are incoming packets to process.
This is accomplished using a new Alarm class and a BlockedSnoozing state.
Basically, you call Process::snooze_until(some_alarm) and then the scheduler
won't wake up the process until some_alarm.is_ringing() returns true.
2019-03-20 17:09:46 +01:00
Andreas Kling
93aa4d581d Meta: Tweak ReadMe and add a new screenshot. 2019-03-20 15:52:37 +01:00
Andreas Kling
cdb82f6fbb LibC: Fix bug in scanf() family where we'd capture invalid data. 2019-03-20 15:29:04 +01:00
Andreas Kling
951377e93e GTableView: Add ability to hide individual columns at view-level.
Use this in IRCClient to hide the "sender" column in the server message view
since everything in that view comes from the "Server" anyway.
2019-03-20 13:36:07 +01:00
Andreas Kling
d17a91f185 Move WindowServer into Servers. 2019-03-20 04:34:14 +01:00
Andreas Kling
9120b05a40 Rename DNSLookupServer => LookupServer. 2019-03-20 04:26:30 +01:00
Andreas Kling
67009cee8e IRCClient: Add ability to change nickname. 2019-03-20 04:21:58 +01:00
Andreas Kling
4ea625e08b Userland: Allow ping <hostname> :^) 2019-03-20 03:38:09 +01:00
Andreas Kling
696f9c5bc0 LibC: Let gethostbyname() handle IPv4 address as input.
It would be neat to do a reverse lookup too, but for now we just parse
the IPv4 address into a dword.
2019-03-20 03:37:05 +01:00
Andreas Kling
f47945759b LibGUI: Make GTableModel a retainable object.
It became clear that this class needs to support multiple owners.
2019-03-20 03:27:07 +01:00
Andreas Kling
41c744b3c8 Kernel: Don't panic if a call redirected to Device::open() has an error.
Just pass the error to the user. I hit this when opening so many Terminal
windows that PTYMultiplexer::open() ran out of master/slave pairs.
2019-03-20 02:55:12 +01:00
Andreas Kling
6f966ca51d Kernel: Accepting sockets don't need to retain the client sockets.
This is all taken care of by the respective FileDescriptors.
Before this patch, we were leaking every single socket, not great!
2019-03-20 02:48:02 +01:00
Andreas Kling
e48cbf3c8c Kernel: connect() should fail with EISCONN for already-connected sockets.
Also make sure to reset the socket role if Socket::connect() fails.
2019-03-20 02:38:36 +01:00
Andreas Kling
4aa0ab4e08 Kernel: Fix race between accept() and connect().
We had a bug where an accepted socket would appear to be EOF/disconnected
on the accepting side until the connecting side had called attach_fd().

Fix this by adding a new SocketRole::Connecting state.
2019-03-20 02:33:51 +01:00
Andreas Kling
31d3616027 WindowServer: Don't crash when accept() fails, just log an error.
This was easy to hit by opening enough windows to hit the max open file
descriptors limit. :^)
2019-03-20 02:31:31 +01:00
Andreas Kling
a02c945ef2 Kernel: DoubleBuffer can return early if read/write is called with !size. 2019-03-20 02:12:40 +01:00
Andreas Kling
1c423f7691 Terminal: Disable the semitransparent Terminal effect for now.
It's cool and everything but the lag is annoying me while I'm trying to
get shit done. I'll definitely reenable it once it's been optimized.
2019-03-20 02:10:44 +01:00
Andreas Kling
0e4a1936ca LibC: Implement gethostbyname() by talking to the DNSLookupServer.
We now talk to the lookup server over a local socket and it does the lookup
on our behalf. Including some retry logic, which is nice, because it seems
like DNS requests disappear in the ether pretty damn often where I am.
2019-03-20 01:15:22 +01:00
Andreas Kling
3ecfde193a GEventLoop: Quit the event loop on EOF from the WindowServer. 2019-03-20 01:10:52 +01:00
Andreas Kling
fe2fa4ac80 DNSLookupServer: Start working on a userspace DNS resolver.
This doesn't have any server functionality just yet, but it does post
decent-looking DNS queries and parse the responses.
2019-03-19 16:29:06 +01:00
Andreas Kling
d0559c0e27 IRCClient: Scroll windows to bottom when new messages arrive.
This will need some tweaking to feel truly good, but this is already
better than just staying at the top while messages come in.
2019-03-19 03:09:51 +01:00
Andreas Kling
9551e2e4b5 LibGUI: Add GScrollableWidget::scroll_to_bottom/top(). 2019-03-19 03:09:21 +01:00
Andreas Kling
e15cc4509f LibGUI: More GInputBox refinements.
Fix some GBoxLayout bugs to make the buttons in GInputBox line up better.
There are still some imperfections due to rounding errors.
2019-03-19 03:00:42 +01:00
Andreas Kling
46577a6948 GTextEditor: Fix invalidation glitches in single-line mode. 2019-03-19 02:45:49 +01:00
Andreas Kling
a0411f61f8 IRCClient: Make the IRCWindow input box look symmetrical. 2019-03-19 02:45:01 +01:00
Andreas Kling
31bc42c530 IRCClient: Ignore empty strings from the toolbar action input boxes. 2019-03-19 02:30:16 +01:00
Andreas Kling
c151b0370d IRCClient: Fix broken handling of RPL_WHOISIDLE. 2019-03-19 02:28:34 +01:00
Andreas Kling
f88e550998 LibGUI: More work on GInputBox.
- If the GInputBox has a parent and the parent is a GWindow, center the
  input box window within the parent window. This looks quite nice.

- Stop processing events in a nested event loop immediately after it's
  been asked to quit.

- Fix GWidget::parent_widget() behavior for non-widget parents.
2019-03-19 02:22:49 +01:00
Andreas Kling
a6538feed1 LibGUI: Add GInputBox for getting a string from a modal dialog.
Use this to implement some of the toolbar actions in IRCClient. :^)
2019-03-19 01:41:00 +01:00
Andreas Kling
b87c099535 WindowServer: Don't allow Logo+RMB to resize blocked-by-modal windows. 2019-03-19 01:40:41 +01:00
Andreas Kling
43304d2adf WindowServer: Add special treatment for modal windows.
While a WSClientConnection has a modal window showing, non-modal windows
belonging to that client are not sent any events.
2019-03-19 00:52:39 +01:00
Andreas Kling
57ff293a51 LibGUI: Implement nested event loops to support dialog boxes.
This patch adds a simple GMessageBox that can run in a nested event loop.
Here's how you use it:

    GMessageBox box("Message text here", "Message window title");
    int result = box.exec();

The next step is to make the WindowServer respect the modality flag of
these windows and prevent interaction with other windows in the same
process until the modal window has been closed.
2019-03-19 00:01:02 +01:00
Andreas Kling
55aa819077 IRCClient: Colorize some channel messages (joins, parts, topics) 2019-03-18 20:56:45 +01:00
Andreas Kling
794c81626e WindowServer: Cache the last two backing stores to make flipping faster.
Instead of reattaching to the shared buffer on every flip, keep a reference
to the last seen backing store GraphicsBitmap. This way we can simply
swap the two last buffers when a flip happens.

This does increase memory consumption in apps that disable double-buffering
but I'll address that issue separately.
2019-03-18 20:52:23 +01:00
Andreas Kling
214b67defd AK: Add Vector::remove_first_matching(Callback).
This is a nice little helper to remove one item based on a matching
callback without having to do iteration yourself.
2019-03-18 20:51:40 +01:00
Andreas Kling
d7659ceebf IRCClient: Add support for a bunch of numerics, mostly WHOIS related. 2019-03-18 15:36:32 +01:00
Andreas Kling
a319641fc4 GIODevice: Remove debug spam. 2019-03-18 15:36:16 +01:00
Andreas Kling
9ad076178a GIODevice: Add a read_all() that returns a ByteBuffer with all we can read.
Use this to implement file opening in TextEditor.
2019-03-18 14:38:30 +01:00
Andreas Kling
8e3d0a23d5 LibGUI: Add GTCPSocket and base class GSocket (inherits from GIODevice.)
And use these to do the line-by-line reading automagically instead of having
that logic in IRCClient. This will definitely come in handy.
2019-03-18 14:09:58 +01:00
Andreas Kling
d466f2634d LibGUI: Add GTableModel::Role::ForegroundColor.
This makes it possible to specify the text color for each table cell.
Use this to make the IRCClient show unread window list items in red.
2019-03-18 04:54:07 +01:00
Andreas Kling
f4b8e4966f SharedGraphics: Add Color::to_string().
This generates a string in the format "rgba(%d, %d, %d, %d)".
2019-03-18 04:53:09 +01:00
Andreas Kling
c24d4b07db IPv4: Add simple pseudorandom ephemeral port allocators for TCP and UDP. 2019-03-18 04:03:44 +01:00
Andreas Kling
77a782a67e LibGUI: Don't crash if calling GClipboard::set_data() with a null string. 2019-03-18 02:59:08 +01:00
Andreas Kling
ce7017e1ec LibGUI: Add GFile and base class GIODevice.
Working with the LibC API's is tedious, so let's add some comfy C++ API's.
2019-03-17 15:54:43 +01:00