History log of /haiku/src/servers/app/Screen.cpp
Revision Date Author Comments
# 0e268215 18-Feb-2024 X512 <danger_mail@list.ru>

app_server/Screen: fix finalization order to avoid use after free

Change-Id: I41ba464a365be9449dfd47b2248746b9a338769e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7416
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>


# 1c88f77d 22-Aug-2021 Adrien Destugues <pulkomandy@pulkomandy.tk>

app_server: turn DPMS on only after setting a valid mode

It's not allowed to enable the screen before having set a mode. At least
in the case of the intel_extreme driver, this creates some problem. Move
the call just a bit later in the init process, where the mode is already
set.

Change-Id: Iaa665f0edc15316890032f1a5928f33634dc8749
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4362
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: François Revol <revol@free.fr>
Reviewed-by: <BeagleJoe13@gmail.com>


# 627fb72d 14-Jul-2021 François Revol <revol@free.fr>

app_server: only turn screens on once at start

Previous code from hrev55212 was triggered on every workspaces change.

Fixes #17078.

Change-Id: I13108cddbd57662650e06c05bd43931c12b3dfae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4208
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 779ab335 09-Dec-2020 X512 <danger_mail@list.ru>

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>


# d99d8dbd 27-Aug-2020 X512 <danger_mail@list.ru>

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>


# 54d72f06 18-May-2018 Murai Takashi <tmurai01@gmail.com>

Fix calling abs(unsigned)

Casting the substraction result to int
since call of overloaded 'abs(uint)' is ambiguous.

Change-Id: I24b4919f8a487d275f537391132cae635aaa030e


# 0c9bc63e 27-May-2013 Axel Dörfler <axeld@pinc-software.de>

app_server: added more debug output on screen change problems.


# 68667bf4 04-Oct-2009 Michael Lotz <mmlr@mlotz.ch>

* Adding a remote desktop interface that operates on app_server drawing
primitives by providing a RemoteDrawingEngine and a RemoteHWInterface.
Not really optimized yet, still a bit WIP.
* Adding corresponding infrastructure like a blocking ring buffer and network
sender/receiver that are attached to the buffers to feed/drain them as well
as a RemoteMessage helper that provides a message based interface.
* Adding target screen concept to request an app to be run on a specific screen.
It's controlled by the TARGET_SCREEN environment variable which is added on
the app side and sent to the app_server.
* Right now only remote target screens are supported, in which case a new
RemoteHWInterface is created that tries to connect to the given host:port.
* Fix shape bounds when drawing, they need to be translated by the pen position
and converted to screen like the points as well. Wasn't visible though as the
bounds weren't used in the normal DrawingEngine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33417 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0eed9183 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Rewrote screen configuration management: VirtualScreen doesn't have anything
to do with the configurations now, instead, there is a separated
ScreenConfigurations class that maintains all known screen_configurations
per workspace (and the Workspace::Private class has two of them, one for the
current modes, one for the stored modes).
* Added Desktop::{Get|Set}ScreenMode() methods, ServerApp now only calls those.
* Getting and setting of anything else than the current screen is now supported.
* This change also fixes that a temporarily set screen mode was not being
restored on workspace switch.
* Also, the Deskbar now seems to have the wrong location a lot, which is
something that should be easily fixable therefore. I will look into this next.
* Got rid of the unhandy screen_id structure server side, and in BPrivateScreen;
we now just use an int32 - the next API break should definitely replace the
screen_id with a simple typedef.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32541 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 756f5c98 09-Aug-2009 Rudolf Cornelissen <rudolf.cornelissen@gmail.com>

fixed BScreen mode.flags handling. This is now compatible with BeOS, and fixes for instance the use of Dualhead Setup for the Matrox and nVidia driver which make use of 'free' flags. A modeset command should be relayed to the accelerant even if it differs by just a single bit: the accelerant best knows how to handle this. Remark: Haiku's screen preflet refuses to set modes once a virtual screen is set since it doesn't recognize the currently set mode. I guess that could be fixed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32212 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 07ff9929 25-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

Add missing newline in debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31754 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0017304e 10-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Correct a small style violation noted by Axel, and add a TODO note.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28799 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 27c43a2d 08-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Implement the missing pieces to handle per workspace display mode support.
Adjust Workspace view to correctly scale each workspace based on the
resolution of that workspace. This exposes one or two anomalies in other
places in the app_server code though which I wasn't able to track down.
This fixes ticket #693.




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28785 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0dcbaee2 06-Oct-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Screen was assuming setting a 800x600 mode would work anyway, but currently the Intel driver only supports the 'native' mode for laptop panels. Added a 'strict' parameter to SetBestMode which, if true, fails if it doesn't find any mode with the passed width. If false, and can't find any good mode, just uses the first mode in the list (could be improved). This fixes bug #2350

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27898 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1938efc0 03-Jun-2008 Axel Dörfler <axeld@pinc-software.de>

* Renamed the "simple" mode setter Screen::SetMode() variant to SetBestMode();
it can also no longer create a default mode.
* This SetBestMode() function now follows a similar logic than the boot loader,
that is, only the width must not deviate, all other values are chosen as
close to the original as possible.
* VirtualScreen::AddScreen() now follows the same logic as the boot loader in
case no configuration was found, and the current screen has no preferred mode
(for example via EDID). That is, it will first try 1024x768, and then 800x600.
* This means there is no mode change anymore when switching from the boot
loader to the app_server in Qemu and VMware.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25782 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 953d895e 07-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Got rid of the "Layer" part of WindowLayer, ViewLayer, WorkspacesLayer
(now WorkspacesView), OffscreenWindowLayer.
* Renamed ServerScreen.cpp/h to Screen.cpp/h (the class was already called
Screen).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24303 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0c9bc63e5c7877a66a478fbd2d2b2c17082ed810 27-May-2013 Axel Dörfler <axeld@pinc-software.de>

app_server: added more debug output on screen change problems.


# 68667bf48a9e29a2d142cb3308b606d80bee3c2d 04-Oct-2009 Michael Lotz <mmlr@mlotz.ch>

* Adding a remote desktop interface that operates on app_server drawing
primitives by providing a RemoteDrawingEngine and a RemoteHWInterface.
Not really optimized yet, still a bit WIP.
* Adding corresponding infrastructure like a blocking ring buffer and network
sender/receiver that are attached to the buffers to feed/drain them as well
as a RemoteMessage helper that provides a message based interface.
* Adding target screen concept to request an app to be run on a specific screen.
It's controlled by the TARGET_SCREEN environment variable which is added on
the app side and sent to the app_server.
* Right now only remote target screens are supported, in which case a new
RemoteHWInterface is created that tries to connect to the given host:port.
* Fix shape bounds when drawing, they need to be translated by the pen position
and converted to screen like the points as well. Wasn't visible though as the
bounds weren't used in the normal DrawingEngine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33417 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0eed9183061a7763972bc2589f9c43489cd078ab 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Rewrote screen configuration management: VirtualScreen doesn't have anything
to do with the configurations now, instead, there is a separated
ScreenConfigurations class that maintains all known screen_configurations
per workspace (and the Workspace::Private class has two of them, one for the
current modes, one for the stored modes).
* Added Desktop::{Get|Set}ScreenMode() methods, ServerApp now only calls those.
* Getting and setting of anything else than the current screen is now supported.
* This change also fixes that a temporarily set screen mode was not being
restored on workspace switch.
* Also, the Deskbar now seems to have the wrong location a lot, which is
something that should be easily fixable therefore. I will look into this next.
* Got rid of the unhandy screen_id structure server side, and in BPrivateScreen;
we now just use an int32 - the next API break should definitely replace the
screen_id with a simple typedef.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32541 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 756f5c98b86772b3b3ee707014a6065babdfc649 09-Aug-2009 Rudolf Cornelissen <rudolf.cornelissen@gmail.com>

fixed BScreen mode.flags handling. This is now compatible with BeOS, and fixes for instance the use of Dualhead Setup for the Matrox and nVidia driver which make use of 'free' flags. A modeset command should be relayed to the accelerant even if it differs by just a single bit: the accelerant best knows how to handle this. Remark: Haiku's screen preflet refuses to set modes once a virtual screen is set since it doesn't recognize the currently set mode. I guess that could be fixed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32212 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 07ff9929e58563ec7d2aab43a73bf2606b488647 25-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

Add missing newline in debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31754 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0017304e3d0be303b4c0e1330952eb949dd56142 10-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Correct a small style violation noted by Axel, and add a TODO note.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28799 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 27c43a2d8f20fd98050c6acd9abac970b1d4d7c8 08-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Implement the missing pieces to handle per workspace display mode support.
Adjust Workspace view to correctly scale each workspace based on the
resolution of that workspace. This exposes one or two anomalies in other
places in the app_server code though which I wasn't able to track down.
This fixes ticket #693.




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28785 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0dcbaee24ad7b51f69440f4d23c2a74eda29bad1 06-Oct-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Screen was assuming setting a 800x600 mode would work anyway, but currently the Intel driver only supports the 'native' mode for laptop panels. Added a 'strict' parameter to SetBestMode which, if true, fails if it doesn't find any mode with the passed width. If false, and can't find any good mode, just uses the first mode in the list (could be improved). This fixes bug #2350

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27898 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1938efc0a9ed64e1f4ffd4e29be18e945f625e92 03-Jun-2008 Axel Dörfler <axeld@pinc-software.de>

* Renamed the "simple" mode setter Screen::SetMode() variant to SetBestMode();
it can also no longer create a default mode.
* This SetBestMode() function now follows a similar logic than the boot loader,
that is, only the width must not deviate, all other values are chosen as
close to the original as possible.
* VirtualScreen::AddScreen() now follows the same logic as the boot loader in
case no configuration was found, and the current screen has no preferred mode
(for example via EDID). That is, it will first try 1024x768, and then 800x600.
* This means there is no mode change anymore when switching from the boot
loader to the app_server in Qemu and VMware.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25782 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 953d895e020ece5d50cfc2e76d9f370ceb5c45e7 07-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Got rid of the "Layer" part of WindowLayer, ViewLayer, WorkspacesLayer
(now WorkspacesView), OffscreenWindowLayer.
* Renamed ServerScreen.cpp/h to Screen.cpp/h (the class was already called
Screen).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24303 a95241bf-73f2-0310-859d-f6bbb57e9c96