DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2082
Version: 1.3-feature
Link: http://www.fltk.org/str.php?L2082
Version: 1.3-feature
Index: src/Fl_Window.cxx
===================================================================
--- src/Fl_Window.cxx (revision 6622)
+++ src/Fl_Window.cxx (working copy)
@@ -51,6 +51,7 @@
}
i = 0;
xclass_ = 0;
+ xtype_ = FL_NORMAL_WINDOW;
icon_ = 0;
iconlabel_ = 0;
resizable(0);
Index: src/Fl_x.cxx
===================================================================
--- src/Fl_x.cxx (revision 6622)
+++ src/Fl_x.cxx (working copy)
@@ -1528,6 +1528,21 @@
(unsigned char *)buffer, p-buffer-1);
}
+ // set the window type to normal
+ Atom net_wm_type = XInternAtom(fl_display, "_NET_WM_WINDOW_TYPE",
False);
+ Atom net_wm_type_kind = 0;
+ switch(win->xtype()) {
+ case FL_DIALOG_WINDOW:
+ net_wm_type_kind = XInternAtom(fl_display,
"_NET_WM_WINDOW_TYPE_DIALOG", False);
+ break;
+
+ case FL_NORMAL_WINDOW:
+ default:
+ net_wm_type_kind = XInternAtom(fl_display,
"_NET_WM_WINDOW_TYPE_NORMAL", False);
+ }
+ XChangeProperty(fl_display, xp->xid, net_wm_type, XA_ATOM, 32,
PropModeReplace, (unsigned char*) &net_wm_type_kind, 1);
+
+
if (win->non_modal() && xp->next && !fl_disable_transient_for) {
// find some other window to be "transient for":
Fl_Window* wp = xp->next->w;
Index: FL/Enumerations.H
===================================================================
--- FL/Enumerations.H (revision 6622)
+++ FL/Enumerations.H (working copy)
@@ -572,6 +572,11 @@
FL_FREE_LABELTYPE ///< first free labeltype to use for creating
own labeltypes
};
+enum Fl_Windowtype { // window type
+ FL_NORMAL_WINDOW = 0, ///< A normal window (default)
+ FL_DIALOG_WINDOW ///< A dialog window
+};
+
/**
Sets the current label type end return its corresponding Fl_Labeltype
value.
@{
Index: FL/Fl_Window.H
===================================================================
--- FL/Fl_Window.H (revision 6622)
+++ FL/Fl_Window.H (working copy)
@@ -60,6 +60,7 @@
const char* iconlabel_;
const char* xclass_;
+ Fl_Windowtype xtype_;
const void* icon_;
// size_range stuff:
int minw, minh, maxw, maxh;
@@ -276,6 +277,20 @@
is not copied.
*/
void xclass(const char* c) {xclass_ = c;}
+
+ /** See void Fl_Window::xtype(Fl_Windowytype) */
+ Fl_Windowtype xtype() const {return xtype_;}
+ /**
+ The classification to tell the system what type of window this is.
Under X,
+ this is used by the window managers to apply consistent decoration,
+ stacking, etc. to all windows of the same type.
+ <P>By default, a Fl_Window is created as a <I>Normal</I> window. Use
this to indicate
+ that this Fl_Window is of another kind (e.g. a dialog window).
+
+ \todo Add appropriate utilisation of this by "other" OSes.
+ */
+ void xtype(Fl_Windowtype t) {xtype_ = t;}
+
/** Gets the current icon window target dependent data */
const void* icon() const {return icon_;}
/** Sets the current icon window target dependent data */
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev