Commit Graph

4495 Commits

Author SHA1 Message Date
CodeforEvolution 123406799f input_server: Properly implement watch_input_devices() & add documentation
Allow for multiple programs to watch for changes in the state
of input devices connected to the system. Previously only one program
at a time could watch input devices. While this functionality was not
implemented in BeOS R5, it was at least documented in the BeBook.

Also added some API documentation where necessary for the function
and related constants.

Change-Id: Icd927998cffcab212bb63bcf10c64c620e9da9a2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3872
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-04-19 19:48:29 +00:00
Tri-Edge AI 773d5303d1 app_server: Implement B_OUTLINE_RESIZE
- Allows applications to be resized without the window contents resizing with the window frame.
- Due to the nature of out-of-tree decorators using private APIs, this will require all pre-existing decorators to be rebuilt
- Newer decorators won't work on older versions of Haiku...
- Also has some formatting with license headers.
- Fixes #2724

Change-Id: Id0b45e7bbc0b636e6dffbd396eb584bf348b5296
Reviewed-on: https://review.haiku-os.org/c/haiku/+/344
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jacob Secunda <secundaja@gmail.com>
2021-03-19 10:17:01 +00:00
Murai Takashi 741032ea6d servers/app: Fix double delete
Pointed out by Clang Static Analyzer.

Change-Id: Ifba9ffd03a49fd66cc3e3c7cacaee641b7e939ab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3774
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-16 17:01:47 +00:00
Alexander G. M. Smith 3376ed1a72 Package Kit: Proper Installation for First Boot Packages
Do the final installation operations for all the packages in the
/system/packages directory when the OS is booted for the first time.

This will run their post-install scripts, create users, groups and generate
settings files (marked with a package version attribute).  Previously we just
ran all the shell scripts found in the /system/boot/post-install directory
(don't do that as much now).

Fixes bug #14382

This patch has simpler code flow in CommitTransactionHandler::_ApplyChanges
Tested on 32 and 64 bit systems.  Once it's official, need to remove the
open_ssh redundant post-install script that creates users etc. from HaikuPorts.
Now we can notice bugs like package version attributes on settings files aren't
fully working. :-)

Didn't remove special case for add_catalog_entry_attributes.sh since it
still does stuff that the build system doesn't do.  Might be able to add
that script as part of the Haiku.hpkg.  See change 3751 for removing it,
https://review.haiku-os.org/c/haiku/+/3751

Change-Id: I3807b78042fdb70e5a79eca2e2a45816ece0236f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2342
Reviewed-by: Alexander G. M. Smith <agmsmith@ncf.ca>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-14 09:10:18 +00:00
Máximo Castañeda 6c04dd4898 Fix subpixel scanline size for fonts with bitmaps
Fixes #16788

Change-Id: If4c5a6e37ab5950c2426286d5afab59652a2a61b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3743
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-02-28 11:16:22 +00:00
X512 779ab335dd use .IsSet() instead if .Get() != NULL
Change-Id: Ia2b7a719fd398e78cc3b11d4f7b02cb81179f65f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3488
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-02-02 15:17:54 +00:00
Jérôme Duval 89dae40a65 net_server: handle EINTR on select()
Change-Id: I90af101cef72b33ecb6decec911d03f592c1ec7c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3729
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2021-02-01 19:35:02 +00:00
Stephan Aßmus f866207173 Package Server: Handle existing files when commiting transaction
Package files to be committed may already exist in the packages folder,
there is no good reason to fail the transaction. These may be packages
which are not activated, or there may be other reasons. While I have
not investigated how this situation may form, I don't see a good reason
to spend the time. Simply compare the contents of the existing file
with the file from the transaction, only fail if they are different.

Change-Id: I2a574df38385c8dead8bac2beace94436d43760a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3597
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-05 17:24:51 +00:00
Jeremy Visser 8fe17af9a7 NetServer: set B_UNCONFIGURED_ADDRESS_FAMILIES flag for IPv6 link local mask
In NetServer::_ConfigureIPv6LinkLocal, it was observed that the
IPv6 link local addresses being added by the function had invalid
masks applied, which upon investigation turned out to be
uninitialised memory.

It turns out that this call:

  BNetworkAddress localLinkMask("ffff:ffff:ffff:ffff::");

...internally relies on getaddrinfo(), which only works if the OS
already has an IPv6 address. Since this is the first IPv6 address,
this will always fail. Since the error code is not checked, this
results in uninitialised memory being used as the IPv6 mask.

There are a variety of possible ways to solve this problem, but
the one presented here passes the B_UNCONFIGURED_ADDRESS_FAMILIES
flag which tells the resolver to always resolve IPv6 addresses.

Change-Id: Ic1fbbd7cffdc6ec87cf160b9d7b02f077d2cf659
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3548
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-27 13:19:34 +00:00
X512 ebe6011c58 app_server: do not flush back buffer outside of clipping
Introduce DrawTransaction that automatically hide/show floating overlays
and flush back buffer.

Fixes #15574.

Change-Id: I30088b74fc66cfcd5b2b433b34141e7d496f68a1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3496
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-15 12:00:12 +00:00
X512 cdccd323b5 use common AutoDeleter types
Change-Id: I115e14b76f3ff049c5f7d9471efd3619a0038fcf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3483
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-13 19:14:13 +00:00
X512 36aafa560b fix build after CObjectDeleter interface change
Change-Id: I76e217abcd13c22c4d68170e07333cdde4d7a891
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3461
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
Adrien Destugues 5d1042057b Add Noto Sans Symbols2 to font fallbacks
Also use the correct symbol for the return key (we were using another
similar arrow because this one was not available in DejaVu Sans).

Fixes #14034.

Note that build/jam/repositories/HaikuPorts ships an old version of the
Noto package that does not include the Symbols2 font. It should be
updated. Adding this to the pile of lagging behind packages, alongside
icu, mawk/gawk, and tnftp. Can anyone take care of it?
2020-12-09 20:00:26 +01:00
X512 d99d8dbdd2 app_server memory management: use ObjectDeleter to mark ownership
Make object ownership explicit by use of ObjectDeleter where possible.

Change-Id: I499a00aa3390d1510ae284419e73faffa5166430
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2695
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-12-03 18:45:14 +00:00
Adrien Destugues 5f51a74f1a Build fix.
Some code in a just merged patch needs another one that's still being
discussed on Gerrit. Extract just the parts we need to get things
building again.
2020-12-02 20:05:20 +01:00
X512 60d3078585 app_server memory management fixes: use BReference
Use BReference for more automated reference counting in app_server,
fixing some use-after-free and other problems.

Extracted from https://review.haiku-os.org/c/haiku/+/2695

Change-Id: I141bb248229405896b29feff3338447f7257b0b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3175
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-02 17:59:06 +00:00
Máximo Castañeda a1c9aa9d90 Get a fallback font for each missing character
Make the glyph layout engine look for a suitable font fallback for each
missing character, instead of using the first one found for all of them.

Solves #16404, #16213, maybe other garbled text issues.

Does not solve similar issues of getting slightly different positions and
widths for a whole string than for the sum of its parts due to subpixel
rendering (cf #15007 comment 2).

Change-Id: I40664e32c8ecd5f09e10aa7a60fcdaec230471b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3273
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-01 11:45:27 +00:00
X512 be3fde6d02 app_server: perform NULL check before use
Fixes #16610.

Change-Id: Ic377a2faef7279f607298b3b80bc44bc1c6aae36
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3401
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-11-20 18:24:48 +00:00
Murai Takashi 4f819c8959 servers/input: Fix debug build.
Change-Id: I74f90906c12284ee8a2aea9d9525a0a39bf16e64
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3359
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-10-27 10:11:28 +00:00
Murai Takashi f7fbc22a58 servers/app: Fix -Wformat-security
Change-Id: Ia2ad0aac295c7a1ce3aafe571ae71f3aa8a4f433
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3346
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-10-23 07:11:59 +00:00
Alexander von Gluck IV 5646b99778 input/MouseSettings: Fix return to NULL per clang
* This looks wrong, but is functionally equal.
* Supposed to return a MouseSettings*, but returned
  a B_OK (0) on a seemingly error result (NULL).

Change-Id: Id6c50369790b90e38fd6ec037c466c5fb314edf5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3303
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-10-11 15:44:42 +00:00
Jérôme Duval 06ed32b8c4 BCursor: add a constructor with bitmap and point
* enhancement #15169
* get_mouse_bitmap(): also reads the colorspace from app_server.
* docs and tests

Change-Id: Iba63f8a2789530ae596c30b92f14828f31761d98
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3292
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-10-08 08:23:31 +00:00
Adrien Destugues 0d87f2555a app_server: missing null pointer check.
Should fix #16551.
2020-09-29 20:01:46 +02:00
Adrien Destugues 7ace34a6ba app_server: don't reset brightness when switching workspaces
Fixes #16538.
2020-09-28 20:51:10 +02:00
Alexander G. M. Smith a22fa0c977 package kit: Add pre-uninstall scripts feature.
Just like post-install scripts which run shortly after a package is
installed, pre-uninstall scripts are run just before a package is
removed.  Implements enhancement #13427

* Fix script exit code handling vs script launch errors.
* Bump package and repo file version numbers due to new attribute,
  unfortunately makes new .hpkg files not backwards compatible.
* Add pre-uninstall functionality, mostly cloning the post-install
  except in a few places.
* Discover that _RunQueuedScripts() is never called, a future TODO:?
* Update package documentation for pre-uninstall scripts, and use of
  the boot/post-install directory.

Change-Id: I45596255ce74bc102f6e5b606cbf83e4e4347a17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1504
Reviewed-by: Alexander G. M. Smith <agmsmith@ncf.ca>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-21 10:47:57 +00:00
Adrien Destugues 8b2b301059 app_server: save/restore screen brightness settings
The brightness is saved in the screen configurations of the first
workspace. For now, all screens get the same brightness (I can't get
screen IDs to work today). Since we only support setting the brightness
for laptop displays for now, this shouldn't matter. It can be fixed when
app_server gets actual multiple display support.

Fixes #14254

Change-Id: Ib33aa65a73407a65bd469d0efa8542210fec02d4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/362
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-20 13:30:29 +00:00
Adrien Destugues a99221e61a build fix. 2020-09-19 11:07:06 +02:00
X512 6fd2274306 app_server pointer/ownership cleanup: trivial changes
Split apart the work done in https://review.haiku-os.org/c/haiku/+/2695
in smaller, easier to review parts.

This commit contains self-contained/local changes that are unlikely to
cause problems.

Change-Id: Idae27ca440791423e3d090bcfe33f4cc83bbea3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3174
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-19 07:13:19 +00:00
Adrien Destugues 9aea709dda Input prefs: handle errors
Various error handling cases were missing, which would lead to corrupt
settings and crashes. Add the missing error checks and make sure we
always revert to sane settings in case of problems.

Change-Id: Ib72621d6e4974345f5f6ee88e01a918cbf09d7ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3069
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-10 17:15:09 +00:00
Preetpal Kaur 02ad22d6c8 Input: declare BString to get the Mouse Name
Change-Id: I3476f58839202a6fd8c93e325a15045963a9b7b2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3125
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-10 17:15:09 +00:00
Adrien Destugues 68c67d9c5a input_server: manage settings for multiple mouses
Change-Id: Ib879ab30057e365cf96e4b9e6295489b8aa1199a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3128
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-10 17:15:09 +00:00
Preetpal Kaur 33f4d9b52b input_server: prepare for multiple mouse settings handling
Add MultipleMouseSettings class in input_server mouse settings code.

It is identical to the one in input preferencdes, but manages a
different implementation of the MouseSettings (which is kept as it was
before)

Change-Id: I4d96bb3702160c4ab9cf5411573e9609ee1f88a6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3129
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-10 17:15:09 +00:00
John Scipione 90f9b5590f App Server: Save decorator path on load, fixes #16412
Change-Id: Ia536764d4abb79772e4d3f16e2364d87792d60fd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3150
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-08-19 03:22:09 +00:00
Adrien Destugues b78a83eb29 app_server: Style fix 2020-07-29 20:13:58 +02:00
Adrien Destugues fd3f9c4126 Allow setting a "full and half fixed" font as the system fixed font.
Fixes #14424.
2020-07-29 20:13:58 +02:00
Emir SARI 60a6f1d5d7 Set Noto Sans Mono as monospace default font
Should help improve [1].

[1]: https://github.com/haikuports/haikuports/issues/3116

Change-Id: I29dd94e3380c3a5935d47d97e2a2ac1c5fb7e774
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3070
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-28 16:42:18 +00:00
Adrien Destugues 5b98fa06d5 input server and preferences: fix debug build 2020-07-25 15:18:04 +02:00
X512 4399ec510d BPicture: add fill rule support
Change-Id: I068e1c2e8659f7b90c6d7c7331a8bb25ae343fe9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2922
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-12 19:44:43 +00:00
X512 90ab1a44ad BPicture: add gradient support
Fixes #9680.

Change-Id: I0013326559cc40ff26cf7b44794c0b32aea832ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2829
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2020-07-12 19:44:43 +00:00
Adrien Destugues 4ad808b67d app_server: Fix clipping computation in DrawArc
The clipped rect was extended with the stroke width, and then the result
was overwritten.

Fixes #3130.
2020-07-12 13:11:11 +02:00
Kacper Kasper 2899294cf1 app_server: Fix assert in DrawStringDry
Change-Id: I58b86860367df86b77bbdffadeff9843c9c8ab11
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2958
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-03 08:15:17 +00:00
Kacper Kasper 009df98c86 app_server: Fix gcc2 build 2020-06-29 19:44:57 +02:00
Kacper Kasper 97bd6fe8d4 app_server: Implement more composition modes
* Use agg::comp_op classes to blend pixels.
* Subpixel path not implemented.
* Needed by WebKit.
* Implements #10274.

Change-Id: I07b0002196fd0a05fc100bd9f6d703c33cadc85b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2932
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-06-29 14:07:42 +00:00
Augustin Cavalier 176d0e1041 app_server: Make use of BReferenceable in AlphaMask.
Extracted from https://review.haiku-os.org/c/haiku/+/2695
with a few minor tweaks.

May help with #16246, but I could only reproduce it intermittently.
2020-06-20 20:02:35 -04:00
Augustin Cavalier 67ace0bfab app_server: Use RecursiveLocker in AlphaMask instead of BLocker.
This avoids creaing a semaphore where it is not needed, especially
as most of these locks are never used from another thread (in the
reports in #16246, there are thousands of semaphores from this
with only a small handful having a "last acquirer" != 0.)
2020-06-20 19:46:22 -04:00
X512 111247c842 app_server: match behavior when drawing to BPicture
Change-Id: I7676e73bda0eb02a1905888706aab6bb1db401d5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2892
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-06-20 18:33:30 +00:00
Kacper Kasper c63d300251 app_server: fix tiled drawing when phase is outside bitmap bounds
sourceRect has phase baked in. If phasecomponents are larger than bitamp bounds
sourceRect no longer intersects and nothing gets drawn.

Change-Id: Ib3f676b8e78e2d941c89e699f9a0ab39cc93e173
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2916
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-06-13 20:35:29 +00:00
X512 2e4991285b app_server: fix transformations in BPicture
Fixes #16122, #16147.

Change-Id: Iee7aa8a2325d34a526578a58507ea3690459c8d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2898
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-06-10 04:04:24 +00:00
waddlesplash 2d69e313a8 Revert "app_server: fix transformations in BPicture"
This reverts commit b8e5671d53.

Reason for revert: Broke all builds.

Change-Id: Ie7c5b4a3c877894a1dc49a9de7a19f79e7eb2ab7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2897
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-06-10 01:19:59 +00:00
X512 b8e5671d53 app_server: fix transformations in BPicture
Fixes #16122, #16147.

Change-Id: I16a38919d25836546389aff6093415eda781668f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2889
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2020-06-10 01:12:04 +00:00