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();
|
||||
|
||||
status_t InitCheck() const;
|
||||
|
||||
|
||||
sem_id sem;
|
||||
sem_id sem_ack;
|
||||
area_id area;
|
||||
bool started;
|
||||
int next_buffer_state;
|
||||
direct_buffer_info *buffer_info;
|
||||
};
|
||||
|
||||
@@ -100,6 +101,7 @@ direct_window_data::direct_window_data()
|
||||
sem_ack(-1),
|
||||
area(-1),
|
||||
started(false),
|
||||
next_buffer_state(0),
|
||||
buffer_info(NULL)
|
||||
{
|
||||
area = create_area("direct area", (void **)&buffer_info,
|
||||
@@ -2740,12 +2742,21 @@ ServerWindow::HandleDirectConnection(int32 bufferState, int32 driverState)
|
||||
|| (!fDirectWindowData->started
|
||||
&& (bufferState & B_DIRECT_MODE_MASK) != B_DIRECT_START))
|
||||
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;
|
||||
|
||||
if (bufferState != -1)
|
||||
fDirectWindowData->buffer_info->buffer_state = (direct_buffer_state)bufferState;
|
||||
|
||||
fDirectWindowData->buffer_info->buffer_state =
|
||||
(direct_buffer_state)(bufferState | fDirectWindowData->next_buffer_state);
|
||||
fDirectWindowData->next_buffer_state = 0;
|
||||
|
||||
if (driverState != -1)
|
||||
fDirectWindowData->buffer_info->driver_state = (direct_driver_state)driverState;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user