BeOS didn't support transparent views. As documented in the Be Book,
SetViewColor(B_TRANSPARENT_COLOR) only effect is to not fill the
invalidated areas with the view color before calling Draw() (it avoids
flickering, especially when combined with B_FULL_UPDATE_ON_RESIZE).
A previous change made B_TRANSPARENT_COLOR actually make the view
transparent (that is, additionally to the above, the underlying view is
drawn before the transparent children), but it creates compatibility
issues.
In order to keep the API compatible with BeOS, the new behavior is now
enabled explicitly using the B_TRANSPARENT_VIEW flag. This also opens
for future developments like allowing a view color with an alpha
channel (not supported yet).
Adjust programs that require transparent views.
Fixes#15744, #15745.
Helps with #15645.
Change-Id: I529574ea23db0a23579521b263bc8d572775e35a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2275
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This adds documentation for BCardView, BCardLayout and BLayoutBuilder::Cards.
There is also a bit of cleanup for the BSplitView documentation.
It also makes explicit when a developer passes an invalid argument to
BCardLayout::SetVisibleItem(), by making that a debugger() call.
Change-Id: I17ac52cc773bb76c4f81beaa76f72af62a9e10f4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2460
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Scroll bars should look and work identically to before on
HaikuControlLook.
Add DrawScrollBarButton() and DrawScrollBarThumb() and
DrawScrollBarBorder() methods. These methods are used to draw scroll
bars in a generic way so that they can be drawn differently by alternative
control look's (e.g. BeControlLook). Also it gives us back drawing of
scroll bar knobs. However the knob setting is not exposed in the
interface in this commit.
These methods are in addition to the 2 existing DrawScrollBarBackground()
methods that draw the scroll bar background. One draws the area above and
below the thumb and the other is called by the first to actually draw the
area.
The rest of the drawing besides the backgrounds was being done in
BScrollBar before. To draw the scroll bar arrows and thumb we were recyling
other ControlLook methods, while this worked well enough on HaikuControlLook
it wasn't flexible enough for alternative control looks.
DrawScrollBarButton() is used to draw the four scroll buttons and is
typically (so far) used in combination with DrawArrowShape().
DrawScrollBarThumb() draws the scroll bar thumb.
DrawScrollBarBorder() draws a 1px border around the entire scroll bar,
potentially B_KEYBOARD_NAVIGATION_COLOR if focused (although this is
feature not currently used.)
Draw unscrollable scroll bars as if they were disabled including the
buttons with their arrow shapes, background, and thumb.
Add FBC backwords compatibility macros in ControlLook.cpp
Change-Id: I9237c5ce45d17d674785111d51de951e5686306b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/351
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
In hrev53944 selection is cleared if text view lose focus, but it
don't work properly in StyledEdit, causing clearing selection when
menu is opened. Clear selection on lose focus is needed for text controls,
so when you click on another text control, previosly focused text
control should clear selection. This behavior is working in BeOS, so
some investigation is required.
Fixes#15810.
Change-Id: Ie104fc1d7e76c2cd2b97d3a0462856fe70cccbbf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2355
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
That's a bad idea. The drag and drop tracking could get confused enough
to crash app_server (possibly because of calling InitiateDrag multiple
times?)
Fixes#14983.
Pointed by clang.
Change-Id: I3aaad5b1e03385358ccb729251fa31d35108f389
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2392
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
This removes the last usage of the old OpenTracker OpenHashTable,
and so it can now be removed.
Change-Id: I7a7bceef1d3fc74c7fdfa7b079e53576452703dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2339
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Treat bottom left, bottom right, and top left mini-mode like
horizontal mode and go full screen in top right mini-mode.
Change-Id: I55c4c0875b5696e6c193a72d96f309c3b058bf9c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2254
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Contents of BTextControl should be not selected if text is directly clicked.
Selection should be removed if BTextView lose focus.
Change-Id: Ifba914c2ada4fc1aac88205f69a64a4356009469
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2109
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
BMenuWindow::Attach/DetachScrollers can be called when scrollers are
already attached/detached and it should handle this case properly.
Call BMenuWindow::DetachScrollers when scrolling is not needed anymore.
Fixes#8513.
Change-Id: I1f70b63d75106cf33ab1f72d34e221a54b45a75e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2310
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
The implementation file contained some documentation. This has been moved
to the Haiku Book (and is rewritten in most cases). The documentation gives
some insight on how the notification_server works.
Change-Id: I82bafcf57101d4882bdf07e7f731df9cd8adc861
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2299
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
_ConvertToInternal does the same thing, and should get inlined
under normal circumstances, so just use it.
No functional change (intended).
Change-Id: Ic4fc9daeb33ab33967d795065a077f282e844f6d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2297
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
All this (and more) is in Region.dox already.
Change-Id: I94ff154cc78cda87d82941deb30f73cac39c3409
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2295
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
Fix 'fFile' pointer was utilized at line 327
before it was verified against NULL.
Change-Id: I8214bce9a99d783b3c53a7b8c5696b0b0dfc3490
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1440
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* This is the bulk of the work. Anything else should be
minor cleanups and tweaking.
* riscv64 isn't a viable EFI platform yet.. just acting
as a stand-in to test a non-x86 EFI haiku_loader
Change-Id: Ib03de81e2b562e693987b86d7b4318209fb1c792
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2256
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
hrev53379 clears the buffer cache for disconnected clients, and also delete buffers.
This is too early (see #15263, media_addon_server crash), and should only happen
after the buffer is recycled. This can be resolved by abusing the fFlags field of
BBuffer to mark the buffer for deletion, and mark the buffer to be reclaimed.
Some BBuffers don't reside in the SharedBufferList, so we have to mark them as to
be reclaimed. For those in the SharedBufferList, call a new RemoveBuffer(), which
can check whether the buffer is still to be reclaimed. For reclaimed BBuffers,
delete them right away, others can be marked for deletion.
fixes#15606#15263, possibly #15433
Change-Id: I66e94138e7e10a40d4c48e2ac042f816c79f5aab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2245
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>
'Restart media services' in Media Preferences works better.
Change-Id: Ifbffdbd81ee851ae3e7d3dfd14f3d5f41ac155ce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2240
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This is used in Find window and also in Installer.
Remove some unused code (I think leftovers from Tracker InfoWindow
refactoring).
Change-Id: Ic0dd07e06c11b3839adbe5b8ef9598a5b16171a6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2234
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
OpenSSL says we should retry when a non-blocking read finds no data is
pending. But in that case we should not retry immediately, because the
operation should be non-blocking.
Other request types exists such as BFileRequest.
Fixes#15675.
Change-Id: Ib2e07fad4dd9f682d2b9fc0cdbf0ca60ecd3adfb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2200
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: François Revol <revol@free.fr>
In a menu, we use the right side both for submenu arrows and shortcuts.
As a result, when an entry has both a shortcut and a submenu, its
shortcut is not aligned with others, and this does not look so nice.
The spacing for the arrow appears only if there is a submenu in any of
the items in the parent menu.
Change-Id: If91fdcdad36abb0141fb05d1f59141f89540c1db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/355
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>
This should give more meaningful errors in pkgman
(not so sure, feel free to tweak the mapping),
and also avoid running the next job if fetching failed.
Change-Id: If76968f705ff25f7ecf1a5f91d88a02040d24665
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2186
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>
SSL_AUTO_RETRY does not cover this case (it only covers SSL errors, not
underlying socket ones), so we still need to retry reads manually here.
Fixes#14638.
Signed-off-by: Jaroslaw Pelczar <jarek@jpelczar.com>
Change-Id: Ie043af5b7471f626a1ffe100848151c832dcc439
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1853
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
BPath::Flatten() on an empty path returns B_OK in BeOS R5, just
writing an empty entry_ref to the povided buffer. The Haiku
implementation has some additional validation that causes B_NO_INIT to
be returned instead.
This patch attempts to recreate the same behavior of BeOS in this
situation.
* Don't check for initialization in BPath::Flatten(). Instead,
just write an empty entry_ref to the provided buffer if the BPath is
empty.
* Fix estimation of expected size when testing the return value of
BPath::FlattenedSize().
* Clean up warning by removing unecessary forward-declaration of
CppUnit::Test.
Change-Id: I88880cbb298bdcb594c9c8fef48314165c49e9e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2115
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
validate_instantiation(BMessage*, const char*) sets errno for invalid
input, or if the requested class is not found, but it doesn't reset
errno to B_OK if validation succeeds.
I verified that in BeOS R5, errno is set to B_OK if
validate_instantiation succeeds.
This fixes BHandler::Instantiate2 and BHandler::Instantiate3 tests.
Change-Id: I531777e6ba47e9635da2da1fc8c8103bb233b0f3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2136
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This workarounds are no longer needed after hrev53713.
Change-Id: I7b809c79bd9d2345a991f0d2360f79876d10cd6b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2132
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
IsHidden(this) should be used instead of IsHidden() because IsHidden() return
true if window is hidden (at moment of creation for example).
Fixes#15646.
Change-Id: I08c8bacd634139dd62fb239e16cb80f512e4be6d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2128
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
6c67c7d63 was attempting to fix a leak caught by a static analysis
tool, but it actually just introduced a double-free bug. Running
`UnitTester BString` will result in a crash.
The original code was correct because, in the event that realloc()
fails in BString::_Resize(), the value of fPrivateData is still
retained. It will be freed by the destructor of BString only if
fPrivateData is not shared by another BString instance, since BStrings
are copy-on-write.
Note that while the change in 6c67c7d63 caused tests to fail, that
doesn't mean those tests are ideal. They only trigger
BString::_Resize() to fail because they depend on implementation
details of hoard2 which limits allocations via malloc() to
1GB. Most malloc() implementations will allow allocations of arbitrary
sizes using anonymous mappings (mmap on Linux, or create_area() in
Haiku). This is a much bigger change, so for now I'm just adding some
comments so that we can revisit these tests if we make a change to the
allocator.
Change-Id: I208c1c7a76b6b4409d237b911c62bb3198e49dab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2060
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
They have generic names and are likely to conflict with other things. In
particular, there is another BPrivate::TitleView in BColumnListView,
which results in weird behavior (and me wasting days debugging things
and scratching my head) when one links libmedia before libcolumnlistview
and the wrong one ends up being called.
enable to check whether a shutdown process is in progress.
Change-Id: I8efdddb3caa80e9fd188f202b6e92a888a7608e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2042
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
There is no reason to not allow this, and it makes it possible to load
data from eg. a BResource instead of a file, which is very useful.
Remove some unused members in the class and dead code, and fix style
issues.
Change-Id: I94cbd0c13c469ea80f55028cf33dfde2de4365ef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2001
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
Like moveList and copyList, duplicateList could be deleted here.
Pointed out by Clang static analyzer.
Change-Id: Ic80181af960bc8eb759449ea5719e9a439a877a0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1996
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Using the geonames.org API, so we will need an API key for it (similar
to the one used for MLS, deployed by the buildbot)
The unit tests uses the "demo" user, which is restricted to 20000 API
call credits and often expired. But we cannot use our secret key here as
it would need to be available to anyone running the test. If we ever get
to automate running the tests on a buildserver we could probably make it
use the secret username known by our buildbot instead.
Change-Id: Ia16880db82555ce85505ad28e1c623f692f46be0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1873
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
We can convert a bitmap icon to B_RGBA32 and scale it at the same
time if we pass in the right size to IconUtils. Don't error out,
force the icon_size to be either B_LARGE_ICON or B_MINI_ICON,
grab the bitmap at that size then convert and scale it.
Implement a second fallback. If the scaling and converting fails
then use ImportBits to convert the icon from B_CMAP8 to B_RGBA32
then center it without scaling.
Fill with transparent before drawing bitmap to prevent artifacting.
Fixes#9554
Change-Id: I827589236fa4f1521e3139ec29b7d60d51d2f879
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1960
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The tab frame is drawn behind the tabs.
Create a new DrawTabFrame method in BControlLook and HaikuControlLook
that draws the tab frame background.
Until now we've been reusing the DrawInactiveTab method to draw the tab frame
in BTabView. While this works on HaikuControlLook, it doesn't work on other
ControlLook's (such as BeControlLook) that draw their tab frame differently.
Add FBC method to preserve binary compatibility on gcc2 and gcc4.
Move DrawTabFrame method to where _ReservedControlLook1 was in header.
Set rect to area of tab frame in TabView instead of doing the
calculation in HaikuControlLook so that others may benefit.
Change-Id: I513e238914f6d680f495659b6ec902df15555015
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1936
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This was not stored in BeOS, but that looks like an oversight on their
part and adding it is unlikely to break anything.
Change-Id: I5dbaeb85adf97afc5040a3ecc1bff264af0b0b57
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1888
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Follow up to #15135, which created a regression, apps would crash if
using the port pool before creating a BMediaRoster instance. Now the
port pool is entirely managed by the MediaRosterUndertaker, which is
less confusing.
Fixes the media_addon_server crash on shutdown for me as well, but I
don't remember why (I had studied the code and came to the conclusion
that this should fix it, but I don't remember the reasoning).
Fixes#15263, and regressions for apps using the port pool before they
instanciate the BMediaRoster.
Change-Id: I887dbc590d8ee9de391b6eae0206944bfe99325f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1897
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
* With them Debugger doesn't allow setting breakpoints inside functions.
* Workaround for #15159. Further explanation by anevilyak is also there.
Change-Id: I661b7dcb28a4c02f671b85cb5c26fa0bd5a53078
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1892
Reviewed-by: Rene Gollent <rene@gollent.com>
When unarchiving, we can rely on BView to properly restore the colors,
and we should not alter them. So move the code doing that outside of
_InitObject, and into all non-unarchiving constructors instead.
Change-Id: I98050c69bb3b8edf6e77ad0498e2dade5eaadb1d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1887
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
sMutexBuf is allocated by new[] in SSL::SSL(), but freed by delete.
Pointed by LGTM.
Change-Id: Ic16501883be4e3b7ca5fe24e1585b6e14ae3ff36
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1883
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
When closing an unread email via "Close | Leave as 'New'", it's
still set to MAIL:status "Read".
IComparing the BString read from the MAIL:status attribute returns
"0" for a match, which the if-statement turns to false...
Change-Id: I4c3846fd39a6056e4bed8388e41dbf4929798799
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1865
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
When dispatching a message to a BView, pass the message on to the view's
MessageReceived() method rather than invoking one of its handlers (e.g.
KeyDown() or MouseDown()) directly.
This commit moves the existing handler-invoking logic from
BWindow::DispatchMessage() into BView::MessageReceived(), preserving the
existing functionality.
Fixes#15254.
Change-Id: I230c0781df13e54e08573a5a31d7550520c060d5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1723
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>
So many Jamfiles to search through...runs also, but there
are lots of graphical glitches
Change-Id: Ibf9e64566a5b8c5742792ac9b1b0f9ccc6693c8d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1753
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Fix hardcoded black color in SeparatorView that caused invisible or
hard to read labels if you had a dark panel color. E.g MediaPrefs
* DrawBorder in HaikuControl didn't care about dark mode. Added check
for light/dark and changed the Tinting accordingly. We should probably
do the same for FancyBorder style as well.
Change-Id: I065211e56b0db5acd05ea287d6cacf75786f306f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1751
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The code does just fine both if entry is NULL and if it doesn't have an
icon. However, if entry is NULL, this assert calls a method on it, which
is a bad idea.
Change-Id: I80b314db373970d99eb008aeaec6254d14c39ca7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1749
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
Now there is no need to resort to listattr and catattr to see the
attributes of a file. You can get them easily, from the GUI.
Limitations:
- No editing support
- Only a few well-known types are handled
- No support for attributes with array of values or otherwise unexpected
size
- Special handling for B_TIME_FORMAT which is annoyingly of a different
size between 32 and 64bit systems, making the attribute format
slightly incompatible.
The window is a bit small to show all the information, so the "Type"
column is put off-view on the right, one can scroll to it if needed.
Vertically there is space for only 4 to 5 entries. It was suggested that
we could merge the permissions and information tabs, making the new
first tab higher, and thus adding more space to this one as well.
Change-Id: I75d192314bc60378c2f058547485cb9c30263485
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1748
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
- Misplaced popup window for showing truncated paths in full (#15301)
- Crash when using Alt + E to edit the filename (#15302)
- "Link To" information for symlinks does not fit in window (#15303)
Change-Id: I72416ab4473e0b01c33817b9364eb9e9e59172e1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1747
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
- Use layout kit to make a few things simpler
- Separate the view showing the header (icon/name) and the one showing
the extra details, making two simpler files instead of a complex one
- Fix some layouting issues
- The permissions are now in a second tab, allowing to add a third one
with other things (more on that later)
screenshot: http://pulkomandy.tk/drop/fileinfo.png
Change-Id: Ief80815eba749723664f40f1317f8aa4cf692162
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1745
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>
I'm going to split it into even more files, and it's easier to track
what's part of it this way.
Change-Id: I09c302da38ce96f0077c5f53fd17c08cdd6c22c9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1743
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>
Symlink name or attributes may be relevant to the launched app, so it's
important that we pass the unresolved symlink as argv[0] when running
it.
Change-Id: Ie1d73bc4e9d5c3d0476f205ce635aafd9203e553
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1739
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
It has been multiple years since this comment was written; all relevant
apps have added their own hooks around this, so we should now be
"secure by default."
Also spotted by a random Hacker News commenter.
Now SSL certificates with the wrong hostname actually fail to validate.
While I'm at it, remove the usage of BString and just check [0] directly.
Spotted by a random commenter on Hacker News.