Browse Source

Fix for menubar not appearing in the right position

tags/v1.3.1000
falkTX 7 years ago
parent
commit
5719b0044d
3 changed files with 6 additions and 1 deletions
  1. +1
    -0
      FL/x.H
  2. +2
    -1
      src/Fl_Menu.cxx
  3. +3
    -0
      src/Fl_x.cxx

+ 1
- 0
FL/x.H View File

@@ -198,6 +198,7 @@ extern Window fl_xid_(const Fl_Window* w);

FL_EXPORT Fl_Window* fl_find(Window xid);
FL_EXPORT void fl_embed ( Fl_Window *w, Window parent );
extern FL_EXPORT bool fl_embed_called;

// Dummy function to register a function for opening files via the window manager...
inline void fl_open_callback(void (*)(const char *)) {}


+ 2
- 1
src/Fl_Menu.cxx View File

@@ -35,6 +35,7 @@
#include <FL/Fl_Menu_Window.H>
#include <FL/Fl_Menu_.H>
#include <FL/fl_draw.H>
#include <FL/x.H>
#include <stdio.h>
#include "flstring.h"

@@ -827,7 +828,7 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown(
Fl_Group::current(0); // fix possible user error...

button = pbutton;
if (pbutton && pbutton->window()) {
if (pbutton && pbutton->window() && ! fl_embed_called) {
for (Fl_Window* w = pbutton->window(); w; w = w->window()) {
X += w->x();
Y += w->y();


+ 3
- 0
src/Fl_x.cxx View File

@@ -916,8 +916,11 @@ static int wasXExceptionRaised() {

}

bool fl_embed_called = false;

void fl_embed ( Fl_Window *w, Window parent )
{
fl_embed_called = true;
/* this destroys the existing window */
w->hide();
/* embedded windows don't need borders */


Loading…
Cancel
Save