Move the run global to main.hpp

It's used by both wlserver and steamcompmgr.
This commit is contained in:
Simon Ser 2021-08-10 12:05:49 +02:00
parent 24bea3406a
commit 5b776be6d2
5 changed files with 10 additions and 8 deletions

View file

@ -18,6 +18,8 @@
#include "wlserver.hpp"
#include "gpuvis_trace_utils.h"
std::atomic< bool > g_bRun{true};
int g_nNestedWidth = 0;
int g_nNestedHeight = 0;
int g_nNestedRefresh = 0;

View file

@ -1,9 +1,13 @@
#pragma once
#include <atomic>
#define GAMESCOPE_OPTIONS ":R:T:C:w:h:W:H:r:o:NFSvVecsdLnbfxO:"
void wayland_commit(struct wlr_surface *surf, struct wlr_buffer *buf);
extern std::atomic< bool > g_bRun;
extern int g_nNestedWidth;
extern int g_nNestedHeight;
extern int g_nNestedRefresh; // Hz

View file

@ -3049,7 +3049,7 @@ spawn_client( char **argv )
}
}
run = false;
g_bRun = false;
nudge_steamcompmgr();
});
@ -3553,7 +3553,7 @@ steamcompmgr_main (int argc, char **argv)
if ( pollfds[ EVENT_NUDGE ].revents & POLLIN )
dispatch_nudge( g_nudgePipe[ 0 ] );
if ( run == false )
if ( g_bRun == false )
{
break;
}

View file

@ -51,8 +51,6 @@ static struct wlserver_t wlserver = {};
static Display *g_XWLDpy = nullptr;
std::atomic< bool > run{true};
struct wlserver_content_override {
struct wlr_surface *surface;
uint32_t x11_window;
@ -78,7 +76,7 @@ void sig_handler(int signal)
}
wlr_log(WLR_DEBUG, "Received kill signal. Terminating!");
run = false;
g_bRun = false;
}
extern const struct wlr_surface_role xwayland_surface_role;
@ -701,7 +699,7 @@ int wlserver_run(void)
.fd = wl_event_loop_get_fd( wlserver.event_loop ),
.events = POLLIN,
};
while ( run ) {
while ( g_bRun ) {
int ret = poll( &pollfd, 1, -1 );
if ( ret < 0 ) {
if ( errno == EINTR )

View file

@ -59,8 +59,6 @@ struct wlserver_touch {
struct wl_listener motion;
};
extern std::atomic< bool > run;
enum wlserver_touch_click_mode {
WLSERVER_TOUCH_CLICK_HOVER = 0,
WLSERVER_TOUCH_CLICK_LEFT = 1,