summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-06-22LibJS: Don't assert for empty reciever if AllowSideEffects::No is givenAli Mohammad Pur
This parameter is only used if AllowSideEffects::Yes, so there's no reason to pass anything to it if that's not used.
2021-06-22LibWeb: Cache the WebAssembly objects that we hand out to JSAli Mohammad Pur
The spec requires this behaviour, and it's generally faster to do this instead of re-resolving and re-creating the instances anyway.
2021-06-22LibWeb: Use SignedBigInteger::create() to create wasm i64 valuesAli Mohammad Pur
...instead of the terrible from_base10(...to_base10()) hack.
2021-06-22LibWeb: Avoid resolving the wasm call address type on every invocationAli Mohammad Pur
This is a waste of time, and it's not a cheap operation.
2021-06-21LibJS: Add VM::dump_scope_chain()Andreas Kling
This is a handy helper that dumps the current scope chain, starting at the innermost scope.
2021-06-21LibJS: Rename Parser::m_parser_state => m_stateAndreas Kling
Also remove the "m_" prefix from all the public data members.
2021-06-21LibJS: Fix spelling mistake in VariableDeclaration::execute()Andreas Kling
2021-06-21WindowServer: Fix animated cursor regressionTom
2021-06-21cp: Copy sources into destination if it is already a directorySam Atkins
Previously, copying a file to a directory, like this: ```cp README.md Desktop``` correctly copied it to Desktop/README.md, but would fail if the source was also a directory, for example: ```cp -R Documents Desktop``` Now, that correctly copies it to Desktop/Documents, as you would expect. :^)
2021-06-21WindowServer: Focus windows blocked by a modal windowMax Wipfli
If a window which has an active modal window is focused, the modal window starts blinking. In this case, the window (and modal) should still be focused. For this, the order of the checks in process_mouse_event_for_window has to be changed. This fixes #8183.
2021-06-21LibC: Add P_tmpdir macroDaniel Bertalan
2021-06-21SoundPlayer: Handle any input file sample rateNick Miller
This commit addresses two issues: 1. If you play a 96 KHz Wave file, the slider position is incorrect, because it is assumed all files are 44.1 KHz. 2. For high-bitrate files, there are audio dropouts due to not buffering enough audio data. Issue 1 is addressed by scaling the number of played samples by the ratio between the source and destination sample rates. Issue 2 is addressed by buffering a certain number of milliseconds worth of audio data (instead of a fixed number of bytes). This makes the the buffer size independent of the source sample rate. Some of the code is redesigned to be simpler. The code that did the book-keeping of which buffers need to be loaded and which have been already played has been removed. Instead, we enqueue a new buffer based on a low watermark of samples remaining in the audio server queue. Other small fixes include: 1. Disable the stop button when playback is finished. 2. Remove hard-coded instances of 44100. 3. Update the GUI every 50 ms (was 100), which improves visualizations.
2021-06-21LibAudio: Sleep less when the audio buffer is fullNick Miller
When using `aplay` to play audio files with a sample rate of 96000, there were occasional one-second gaps in playback. This is because the Audio::ClientConnection sleeps for a full second when the audio buffer is full. One second is too long to sleep, especially for high-bitrate files. Changing the sleep to a more reasonable value like 100 ms ensures we attempt to enqueue again before the audio buffer runs empty.
2021-06-21LibAudio: Avoid reading past the end of sample dataNick Miller
Prior code in `WavLoader::get_more_samples()` would attempt to read the requested number of samples without actually checking whether that many samples were remaining in the stream. This was the cause of an audible pop at the end of a track, due to reading non-audio data that is sometimes at the end of a Wave file. Now we only attempt to read up to the end of sample data, but no further. Also, added comments to clarify the meaning of "sample", and how it should be independent of the number of channels.
2021-06-21LibJS: Add bytecode support for regexp literalsMatthew Olsson
2021-06-20js: Insert newline after each line in REPL modeyeeter-the-dog
This makes ASI work in the REPL.
2021-06-20LibGUI/TabWidget: Make sure we don't act on two mouseup eventsMarcus Nilsson
Make sure that even if we get two mouseup events, we do not try to remove the same widget twice.
2021-06-20LibWeb: Fix redirects when a response has no dataGil Mendes
This makes redirects work when the HTTP server responds with just headers and no data.
2021-06-20LibJS: Implement support for the [[IsHTMLDDA]] internal slotLinus Groh
Best regards from Annex B and document.all :^)
2021-06-20PixelPaint: Add basic support for closing tabsMarcus Nilsson
This enables closing of tabs in PixelPaint, for the moment very basic with no checking if the image is modified or saved.
2021-06-20Browser: Enable close button on tabsMarcus Nilsson
2021-06-20LibGUI/TabWidget: Add close button to tabsMarcus Nilsson
This adds an optional close button to tabs, useful in for example browser and pixelpaint.
2021-06-20LibJS: Let if yield undefined for branches that don't yield a valueGunnar Beutner
According to 13.6.7 the return value for if expressions should be undefined when the branch statements don't yield a value.
2021-06-20WindowServer: Reload icons on scale changesTom
Since MultiScaleBitmaps only loads icons for the scales in use, we need to unconditionally reload them so that we pick up the correct bitmaps for a scale that hasn't been previously used.
2021-06-20WindowServer: Update compositor reference to cursor on reloadTom
When we reload a cursor we should make sure the compositor has a valid reference to the updated cursor.
2021-06-20WindowServer: Enable screen capture to span multiple screensTom
This enables the shot utility to capture all screens or just one, and enables the Magnifier application to track the mouse cursor across multiple screens.
2021-06-20WindowServer: Load multiple scaled versions of Bitmaps and CursorsTom
This enables rendering of mixed-scale screen layouts with e.g. high resolution cursors and window button icons on high-dpi screens while using lower resolution bitmaps on regular screens.
2021-06-20WindowServer: Add API to set/get screen layoutsTom
This sets the stage so that DisplaySettings can configure the screen layout and set various screen resolutions in one go. It also allows for an easy "atomic" revert of the previous settings.
2021-06-20WindowServer: Validate that all screens can be reachedTom
If there are any screens that are detached from other screens it would not be possible to get to them using the mouse pointer. Also make sure that none of the screens are overlapping.
2021-06-20WindowServer: Fix artifacts after window resize in some casesTom
We were calculating the old window rectangle after changing window states that may affect these calculations, which sometimes resulted in artifacts left on the screen, particularily when tiling a window as this now also constrains rendering to one screen. Instead, just calculate the new rectangle and use the window's occlusion information to figure out what areas need to be invalidated.
2021-06-20WindowServer: Constrain rendering windows to one screen in some casesTom
When a window is maximized or tiled then we want to constrain rendering that window to the screen it's on. This prevents "bleeding" of the window frame and shadow onto the adjacent screen(s).
2021-06-20WindowServer: Add initial support for rendering on multiple screensTom
This allows WindowServer to use multiple framebuffer devices and compose the desktop with any arbitrary layout. Currently, it is assumed that it is configured contiguous and non-overlapping, but this should eventually be enforced. To make rendering efficient, each window now also tracks on which screens it needs to be rendered. This way we don't have to iterate all the windows for each screen but instead use the same rendering loop and then only render to the screen (or screens) that the window actually uses.
2021-06-20LibGfx: Add a Line class and a Rect<T>::RelativeLocation classTom
These helpers will be useful in preparation for supporting multiple displays, e.g. to measure distances to other screens or figure out where rectangles are located relative to each other.
2021-06-20LibCore: Call optional did_construct() method when constucting objectsAli Mohammad Pur
Some objects need to perform tasks during construction that require the object to be fully constructed, which can't be done in the constructor. This allows postponing such tasks into a did_construct method that will be called right after the object was fully constructed.
2021-06-20FlappyBug: Add missing component declarationLinus Groh
The PR for this pre-dates the concept of components, so it was forgotten to add one.
2021-06-20LibJS: Use OrdinaryCreateFromConstructor() in a bunch of constructorsLinus Groh
Resolves various FIXMEs :^)
2021-06-20LibJS: Consistently make prototype the last argument in Object ctorsLinus Groh
This is so that we can reliably allocate them in a template function, e.g. in ordinary_create_from_constructor(): global_object.heap().allocate<T>( global_object, forward<Args>(args)..., *prototype); The majority of objects already take the prototype as the last argument, so I updated the ones that didn't.
2021-06-20LibJS: Implement the OrdinaryCreateFromConstructor() abstract operationLinus Groh
2021-06-20LibJS: Implement the GetPrototypeFromConstructor() abstract operationLinus Groh
2021-06-20LibJS: Implement the GetFunctionRealm() abstract operationLinus Groh
2021-06-20LibJS: Introduce AbstractOperations.{cpp,h} and move various AOs thereLinus Groh
Value.{cpp,h} has become a dumping ground, let's change that. Things that are directly related to Values (e.g. bitwise/binary ops, equality related functions) can remain, but everything else that's not a Value or Object method and globally required (not just a static function somewhere) is being moved. Also convert to east-const while we're here. I haven't touched IteratorOperations.{cpp,h}, it seems fine to still have those separately.
2021-06-20LaunchServer: Correctly open file URLs with line numbersAdam Hodgen
PR #5665 updated TextEditor to open files at a specific line/column location using the file:line:col argument, rather than the -l flag. This change updates LaunchServer to use that convention, though note it does only pass the line number and not a column number, as per all previous behaviour.
2021-06-20FlappyBug: Add cloud and sky graphicsMim Hufford
We now have a nice sunset sky and some random cloud graphics. The obstacles will get graphics at some point too :)
2021-06-20FlappyBug: Add new graphics and tweak colorsMim Hufford
This adds some actual graphics to the game, and tweaks the obstacle and sky colors. Eventually there will be graphics for those elements too.
2021-06-20FlappyBug: Add an input cooldown after game overMim Hufford
This makes sure the player doesn't accidentally start a new game after they bump into an obstacle.
2021-06-20FlappyBug: Keep track of score and highscoreMim Hufford
Better information is now shown to the player. Instructions are shown when first loading the program, and any available scores are shown on the game over screen.
2021-06-20FlappyBug: Start obstacles off the screenMim Hufford
Previously obstacles were respawning fully on-screen which caused a discontinuous look. Now they smoothly move into view from off-screen.
2021-06-20FlappyBug: Make the obstacle gap position randomMim Hufford
The position of the gap in the obstacle is now randomly generated each time it spawns. The game is more fun to play now :)
2021-06-20FlappyBug: Introduce a new Flappy Bug gameMim Hufford
This introduces a Flappy Bug game. It's pretty simple currently, but is playable.
2021-06-20LibCoreDump: Don't subtract one from the first stack frame's EIPGunnar Beutner
The first stack frame represents the current instruction pointer rather than the return address so we shouldn't subtract one from it. Fixes #8162.