@ -35,6 +35,7 @@ struct sway_transaction_instruction {
struct sway_container_state container_state ;
struct sway_container_state container_state ;
} ;
} ;
uint32_t serial ;
uint32_t serial ;
bool server_request ;
bool waiting ;
bool waiting ;
} ;
} ;
@ -165,7 +166,7 @@ static void copy_container_state(struct sway_container *container,
}
}
static void transaction_add_node ( struct sway_transaction * transaction ,
static void transaction_add_node ( struct sway_transaction * transaction ,
struct sway_node * node ) {
struct sway_node * node , bool server_request ) {
struct sway_transaction_instruction * instruction = NULL ;
struct sway_transaction_instruction * instruction = NULL ;
// Check if we have an instruction for this node already, in which case we
// Check if we have an instruction for this node already, in which case we
@ -188,9 +189,12 @@ static void transaction_add_node(struct sway_transaction *transaction,
}
}
instruction - > transaction = transaction ;
instruction - > transaction = transaction ;
instruction - > node = node ;
instruction - > node = node ;
instruction - > server_request = server_request ;
list_add ( transaction - > instructions , instruction ) ;
list_add ( transaction - > instructions , instruction ) ;
node - > ntxnrefs + + ;
node - > ntxnrefs + + ;
} else if ( server_request ) {
instruction - > server_request = true ;
}
}
switch ( node - > type ) {
switch ( node - > type ) {
@ -364,6 +368,9 @@ static bool should_configure(struct sway_node *node,
if ( node - > destroying ) {
if ( node - > destroying ) {
return false ;
return false ;
}
}
if ( ! instruction - > server_request ) {
return false ;
}
struct sway_container_state * cstate = & node - > sway_container - > current ;
struct sway_container_state * cstate = & node - > sway_container - > current ;
struct sway_container_state * istate = & instruction - > container_state ;
struct sway_container_state * istate = & instruction - > container_state ;
# if HAVE_XWAYLAND
# if HAVE_XWAYLAND
@ -522,7 +529,7 @@ void transaction_notify_view_ready_immediately(struct sway_view *view) {
}
}
}
}
void transaction_commit_dirty ( void ) {
static void _transaction_commit_dirty ( bool server_request ) {
if ( ! server . dirty_nodes - > length ) {
if ( ! server . dirty_nodes - > length ) {
return ;
return ;
}
}
@ -536,10 +543,18 @@ void transaction_commit_dirty(void) {
for ( int i = 0 ; i < server . dirty_nodes - > length ; + + i ) {
for ( int i = 0 ; i < server . dirty_nodes - > length ; + + i ) {
struct sway_node * node = server . dirty_nodes - > items [ i ] ;
struct sway_node * node = server . dirty_nodes - > items [ i ] ;
transaction_add_node ( server . pending_transaction , node );
transaction_add_node ( server . pending_transaction , node , server_request );
node - > dirty = false ;
node - > dirty = false ;
}
}
server . dirty_nodes - > length = 0 ;
server . dirty_nodes - > length = 0 ;
transaction_commit_pending ( ) ;
transaction_commit_pending ( ) ;
}
}
void transaction_commit_dirty ( void ) {
_transaction_commit_dirty ( true ) ;
}
void transaction_commit_dirty_client ( void ) {
_transaction_commit_dirty ( false ) ;
}