Commit graph

6 commits

Author SHA1 Message Date
Andreas Kling
bcc00857a4 AK: Revert Eternal<T> for now since it doesn't work as intended. 2019-04-05 05:14:20 +02:00
Andreas Kling
c02c9880b6 AK: Add Eternal<T> and use it in various places.
This is useful for static locals that never need to be destroyed:

Thing& Thing::the()
{
    static Eternal<Thing> the;
    return the;
}

The object will be allocated in data segment memory and will never have
its destructor invoked.
2019-04-03 16:52:25 +02: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
77a782a67e LibGUI: Don't crash if calling GClipboard::set_data() with a null string. 2019-03-18 02:59:08 +01:00
Andreas Kling
b8581b0069 Seal clipboard buffers after copying data into them.
This is just a quick safety mechanism to ensure that nobody alters the
contents of a clipping after it's been set.

Ultimately this will be replaced by a more sophisticated SHM object.
2019-03-08 13:33:35 +01:00
Andreas Kling
6820f9e14f WindowServer+LibGUI: Add a server-side clipboard.
On the client side, use GClipboard's data() and set_data(String) to access
the global clipboard. :^)
2019-03-08 13:27:19 +01:00