Added some code for notifying client BDirectWindows that the window was moved or resized. Currently commented because of other problems. Looks like the windows bounds are not changed if a MoveBy() is called before the window is shown. Removed unneeded includes. Small changes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14783 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
#include "AppServer.h"
|
#include "AppServer.h"
|
||||||
#include "DrawingEngine.h"
|
#include "DrawingEngine.h"
|
||||||
#include "Globals.h"
|
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "RootLayer.h"
|
#include "RootLayer.h"
|
||||||
#include "ServerConfig.h"
|
#include "ServerConfig.h"
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#include "Decorator.h"
|
#include "Decorator.h"
|
||||||
#include "DrawingEngine.h"
|
#include "DrawingEngine.h"
|
||||||
#include "Globals.h"
|
|
||||||
#include "HWInterface.h"
|
#include "HWInterface.h"
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "ServerApp.h"
|
#include "ServerApp.h"
|
||||||
|
|||||||
@@ -2163,7 +2163,9 @@ ServerWindow::HandleDirectConnection(int bufferState, int driverState)
|
|||||||
// Releasing this sem causes the client to call BDirectWindow::DirectConnected()
|
// Releasing this sem causes the client to call BDirectWindow::DirectConnected()
|
||||||
release_sem(fDirectWindowData->direct_sem);
|
release_sem(fDirectWindowData->direct_sem);
|
||||||
|
|
||||||
// TODO: Waiting 3 seconds in this thread could cause weird things: test
|
// TODO: Waiting 3 seconds in this thread is not a problem,
|
||||||
|
// but since we are called from the RootLayer's thread too, very bad things could happen.
|
||||||
|
// Find some way to call this method only within ServerWindow's thread (messaging ?)
|
||||||
status_t status = acquire_sem_etc(fDirectWindowData->direct_sem_ack, 1, B_TIMEOUT, 3000000);
|
status_t status = acquire_sem_etc(fDirectWindowData->direct_sem_ack, 1, B_TIMEOUT, 3000000);
|
||||||
if (status == B_TIMED_OUT) {
|
if (status == B_TIMED_OUT) {
|
||||||
// The client application didn't release the semaphore
|
// The client application didn't release the semaphore
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <DirectWindow.h>
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
#include <Region.h>
|
#include <Region.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
@@ -20,16 +21,16 @@
|
|||||||
#include "Decorator.h"
|
#include "Decorator.h"
|
||||||
#include "DecorManager.h"
|
#include "DecorManager.h"
|
||||||
#include "Desktop.h"
|
#include "Desktop.h"
|
||||||
#include "Globals.h"
|
|
||||||
#include "MessagePrivate.h"
|
#include "MessagePrivate.h"
|
||||||
#include "PortLink.h"
|
#include "PortLink.h"
|
||||||
#include "RootLayer.h"
|
#include "RootLayer.h"
|
||||||
#include "ServerApp.h"
|
#include "ServerApp.h"
|
||||||
#include "ServerWindow.h"
|
#include "ServerWindow.h"
|
||||||
#include "TokenHandler.h"
|
#include "TokenHandler.h"
|
||||||
|
#include "WinBorder.h"
|
||||||
#include "Workspace.h"
|
#include "Workspace.h"
|
||||||
|
|
||||||
#include "WinBorder.h"
|
|
||||||
|
|
||||||
// Toggle general function call output
|
// Toggle general function call output
|
||||||
//#define DEBUG_WINBORDER
|
//#define DEBUG_WINBORDER
|
||||||
@@ -172,7 +173,20 @@ WinBorder::Draw(const BRect &r)
|
|||||||
void
|
void
|
||||||
WinBorder::MoveBy(float x, float y)
|
WinBorder::MoveBy(float x, float y)
|
||||||
{
|
{
|
||||||
|
if (x == 0 && y == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// TODO: MoveBy and ResizeBy() are usually called
|
||||||
|
// from the rootlayer's thread. HandleDirectConnection() could
|
||||||
|
// block the calling thread for ~3 seconds in the worst case,
|
||||||
|
// and while it would be acceptable if called from the
|
||||||
|
// ServerWindow's thread (only the window would be blocked), in this case
|
||||||
|
// it's not, as also the mouse movement is driven by rootlayer.
|
||||||
|
// Find some way to call DirectConnected() from the ServerWindow's thread,
|
||||||
|
// by sending a message from here or whatever.
|
||||||
|
//Window()->HandleDirectConnection(B_DIRECT_STOP);
|
||||||
Layer::MoveBy(x, y);
|
Layer::MoveBy(x, y);
|
||||||
|
//Window()->HandleDirectConnection(B_DIRECT_START|B_BUFFER_MOVED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -180,8 +194,12 @@ void
|
|||||||
WinBorder::ResizeBy(float x, float y)
|
WinBorder::ResizeBy(float x, float y)
|
||||||
{
|
{
|
||||||
STRACE(("WinBorder(%s)::ResizeBy()\n", Name()));
|
STRACE(("WinBorder(%s)::ResizeBy()\n", Name()));
|
||||||
|
if (x == 0 && y == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Window()->HandleDirectConnection(B_DIRECT_STOP);
|
||||||
_ResizeBy(x, y);
|
_ResizeBy(x, y);
|
||||||
|
//Window()->HandleDirectConnection(B_DIRECT_START|B_BUFFER_RESIZED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user