Avoid sending an extra (useless) B_DIRECT_MODIFY notification to the
client, when the connection is stopped. But cache the "reason" of the notification, and join it with the next one, when B_DIRECT_START is notified. Experimental, could be reverted. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21063 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -85,11 +85,12 @@ struct direct_window_data {
|
|||||||
~direct_window_data();
|
~direct_window_data();
|
||||||
|
|
||||||
status_t InitCheck() const;
|
status_t InitCheck() const;
|
||||||
|
|
||||||
sem_id sem;
|
sem_id sem;
|
||||||
sem_id sem_ack;
|
sem_id sem_ack;
|
||||||
area_id area;
|
area_id area;
|
||||||
bool started;
|
bool started;
|
||||||
|
int next_buffer_state;
|
||||||
direct_buffer_info *buffer_info;
|
direct_buffer_info *buffer_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -100,6 +101,7 @@ direct_window_data::direct_window_data()
|
|||||||
sem_ack(-1),
|
sem_ack(-1),
|
||||||
area(-1),
|
area(-1),
|
||||||
started(false),
|
started(false),
|
||||||
|
next_buffer_state(0),
|
||||||
buffer_info(NULL)
|
buffer_info(NULL)
|
||||||
{
|
{
|
||||||
area = create_area("direct area", (void **)&buffer_info,
|
area = create_area("direct area", (void **)&buffer_info,
|
||||||
@@ -2740,12 +2742,21 @@ ServerWindow::HandleDirectConnection(int32 bufferState, int32 driverState)
|
|||||||
|| (!fDirectWindowData->started
|
|| (!fDirectWindowData->started
|
||||||
&& (bufferState & B_DIRECT_MODE_MASK) != B_DIRECT_START))
|
&& (bufferState & B_DIRECT_MODE_MASK) != B_DIRECT_START))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// If the direct connection is stopped, only continue if a start notification is received.
|
||||||
|
// But save the "reason" of the call (B_BUFFER_RESIZED, B_CLIPPING_MODIFIED, etc)
|
||||||
|
if ((fDirectWindowData->buffer_info->buffer_state & B_DIRECT_MODE_MASK) == B_DIRECT_STOP
|
||||||
|
&& (bufferState & B_DIRECT_MODE_MASK) != B_DIRECT_START) {
|
||||||
|
fDirectWindowData->next_buffer_state |= bufferState & ~B_DIRECT_MODE_MASK;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
fDirectWindowData->started = true;
|
fDirectWindowData->started = true;
|
||||||
|
|
||||||
if (bufferState != -1)
|
fDirectWindowData->buffer_info->buffer_state =
|
||||||
fDirectWindowData->buffer_info->buffer_state = (direct_buffer_state)bufferState;
|
(direct_buffer_state)(bufferState | fDirectWindowData->next_buffer_state);
|
||||||
|
fDirectWindowData->next_buffer_state = 0;
|
||||||
|
|
||||||
if (driverState != -1)
|
if (driverState != -1)
|
||||||
fDirectWindowData->buffer_info->driver_state = (direct_driver_state)driverState;
|
fDirectWindowData->buffer_info->driver_state = (direct_driver_state)driverState;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user