Skip to content

Commit

Permalink
FLTK Wayland bug "fixes":
Browse files Browse the repository at this point in the history
- Wayland assumes alpha of 0.F on glClearColor() is transparent.
- Wayland does not refresh sizes after a resize() needing an Fl::check.
  • Loading branch information
ggarra13 committed Apr 20, 2024
1 parent 44a7ab6 commit f4d3e3c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
6 changes: 6 additions & 0 deletions mrv2/lib/mrvGL/mrvGLViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ namespace mrv
CHECK_GL;

float r = 0.F, g = 0.F, b = 0.F, a = 0.F;

#ifdef FLTK_USE_WAYLAND
if (fl_wl_display())
a = 1.F;
#endif

if (!p.presentation)
{
uint8_t ur, ug, ub;
Expand Down
15 changes: 10 additions & 5 deletions mrv2/lib/mrvGL/mrvTimelineViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ namespace mrv
posX = mw->x();
posY = mw->y();
}

int decW = mw->decorated_w();
int decH = mw->decorated_h();

Expand All @@ -1263,7 +1263,7 @@ namespace mrv
#ifdef _WIN32
miny += dH - dW / 2;
#endif

// Take into account the different UI bars
if (p.ui->uiMenuGroup->visible())
H += p.ui->uiMenuGroup->h();
Expand All @@ -1287,7 +1287,7 @@ namespace mrv

if (p.ui->uiDockGroup->visible())
W += p.ui->uiDockGroup->w();

bool alwaysFrameView = (bool)uiPrefs->uiPrefsAutoFitImage->value();
p.frameView = alwaysFrameView;

Expand Down Expand Up @@ -1333,14 +1333,19 @@ namespace mrv
if (H > maxH)
H = maxH;
}

if (posX + W > maxW)
posX = minx;
if (posY + W > maxH)
posY = miny;

mw->resize(posX, posY, W, H);

#ifdef FLTK_USE_WAYLAND
if (fl_wl_display())
Fl::check();
#endif

p.ui->uiRegion->layout();

set_edit_mode_cb(editMode, p.ui);
Expand Down

0 comments on commit f4d3e3c

Please sign in to comment.