summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-03-04 08:34:10 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-03-04 08:34:10 +0100
commit5ae92f034ac8688bda0d905964eb281f764bf351 (patch)
treecb33db11d6b194b510525bd956b2c4ced9d5ef7d /src/drivers
parentb438d448fbe721ab8d8d24d34373c6ee8c1728e1 (diff)
Simpler use of member variable wl_registry in class Fl_Wayland_Screen_Driver
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.H5
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx20
2 files changed, 12 insertions, 13 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H
index c01b0c19c..a7d551d24 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H
@@ -80,8 +80,6 @@ public:
// static member variables
static FL_EXPORT struct wl_display *wl_display;
- // use it to make sure the Wayland leg was selected and fl_open_display() has run
- static struct wl_registry *wl_registry;
static const struct wl_data_device_listener *p_data_device_listener;
// next length of marked text after current marked text will have been replaced
static int next_marked_length;
@@ -113,11 +111,12 @@ public:
struct wl_cursor *xc_se;
struct wl_cursor *xc_ne;
struct wl_cursor *xc_nw;
+ struct wl_registry *wl_registry;
struct wl_compositor *wl_compositor;
struct wl_subcompositor *wl_subcompositor;
struct wl_shm *wl_shm;
struct seat *seat;
- struct wl_list outputs; // linked list of all screens in system
+ struct wl_list outputs; // linked list of struct output records for all screens in system
struct libdecor *libdecor_context;
struct xdg_wm_base *xdg_wm_base;
struct zwp_text_input_manager_v3 *text_input_base;
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 82ff5846a..735297c70 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -216,7 +216,6 @@ static inline void checkdouble() {
struct wl_display *Fl_Wayland_Screen_Driver::wl_display = NULL;
-struct wl_registry *Fl_Wayland_Screen_Driver::wl_registry = NULL;
Fl_Window *Fl_Wayland_Screen_Driver::surface_to_window(struct wl_surface *surface) {
@@ -610,7 +609,7 @@ int Fl_Wayland_Screen_Driver::compose(int& del) {
void Fl_Wayland_Screen_Driver::compose_reset()
{
- if (!Fl_Wayland_Screen_Driver::wl_registry) open_display();
+ if (!Fl_Wayland_Screen_Driver::wl_display) open_display();
Fl::compose_state = 0;
next_marked_length = 0;
xkb_compose_state_reset(seat->xkb_compose_state);
@@ -1112,6 +1111,7 @@ Fl_Wayland_Screen_Driver::Fl_Wayland_Screen_Driver() : Fl_Unix_Screen_Driver() {
seat = NULL;
text_input_base = NULL;
reset_cursor();
+ wl_registry = NULL;
}
@@ -1150,7 +1150,7 @@ void Fl_Wayland_Screen_Driver::close_display() {
Fl::remove_fd(wl_display_get_fd(Fl_Wayland_Screen_Driver::wl_display));
wl_display_disconnect(Fl_Wayland_Screen_Driver::wl_display);
Fl_Wayland_Screen_Driver::wl_display = NULL;
- Fl_Wayland_Screen_Driver::wl_registry = NULL;
+ wl_registry = NULL;
}
@@ -1171,7 +1171,7 @@ void Fl_Wayland_Screen_Driver::init_workarea()
int Fl_Wayland_Screen_Driver::x() {
- if (!Fl_Wayland_Screen_Driver::wl_registry) open_display();
+ if (!Fl_Wayland_Screen_Driver::wl_display) open_display();
Fl_Wayland_Screen_Driver::output *output;
wl_list_for_each(output, &outputs, link) {
break;
@@ -1180,7 +1180,7 @@ int Fl_Wayland_Screen_Driver::x() {
}
int Fl_Wayland_Screen_Driver::y() {
- if (!Fl_Wayland_Screen_Driver::wl_registry) open_display();
+ if (!Fl_Wayland_Screen_Driver::wl_display) open_display();
Fl_Wayland_Screen_Driver::output *output;
wl_list_for_each(output, &outputs, link) {
break;
@@ -1189,7 +1189,7 @@ int Fl_Wayland_Screen_Driver::y() {
}
int Fl_Wayland_Screen_Driver::w() {
- if (!Fl_Wayland_Screen_Driver::wl_registry) open_display();
+ if (!Fl_Wayland_Screen_Driver::wl_display) open_display();
Fl_Wayland_Screen_Driver::output *output;
wl_list_for_each(output, &outputs, link) {
break;
@@ -1198,7 +1198,7 @@ int Fl_Wayland_Screen_Driver::w() {
}
int Fl_Wayland_Screen_Driver::h() {
- if (!Fl_Wayland_Screen_Driver::wl_registry) open_display();
+ if (!Fl_Wayland_Screen_Driver::wl_display) open_display();
Fl_Wayland_Screen_Driver::output *output;
wl_list_for_each(output, &outputs, link) {
break;
@@ -1208,7 +1208,7 @@ int Fl_Wayland_Screen_Driver::h() {
void Fl_Wayland_Screen_Driver::init() {
- if (!Fl_Wayland_Screen_Driver::wl_registry) open_display();
+ if (!Fl_Wayland_Screen_Driver::wl_display) open_display();
}
@@ -1496,7 +1496,7 @@ void Fl_Wayland_Screen_Driver::reset_spot() {
void Fl_Wayland_Screen_Driver::display(const char *d)
{
- if (d && !seat) { // if display was opened, it's too late
+ if (d && !wl_registry) { // if display was opened, it's too late
if (wl_display) {
// only the wl_display_connect() call was done, redo it because the target
// Wayland compositor may be different
@@ -1574,5 +1574,5 @@ int Fl_Wayland_Screen_Driver::get_key(int k) {
struct wl_display *fl_wl_display() {
- return (Fl_Wayland_Screen_Driver::wl_registry ? Fl_Wayland_Screen_Driver::wl_display : NULL);
+ return Fl_Wayland_Screen_Driver::wl_display;
}