Initial commit
This commit is contained in:
9
contrib/packages/rpm/el6/SOURCES/fetch_sources.sh
Normal file
9
contrib/packages/rpm/el6/SOURCES/fetch_sources.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
SPEC=$1
|
||||
|
||||
SOURCES=`grep -i "^SOURCE\d\+\s*:\s*\([fht]\+tp://.*\)" ${SPEC} | sed -e 's/^.*:[[:space:]]//'`
|
||||
for URL in ${SOURCES} ; do
|
||||
curl -OL ${URL}
|
||||
done
|
||||
|
||||
106
contrib/packages/rpm/el6/SOURCES/fltk-1.3.x-clipboard.patch
Normal file
106
contrib/packages/rpm/el6/SOURCES/fltk-1.3.x-clipboard.patch
Normal file
@@ -0,0 +1,106 @@
|
||||
diff -up fltk-1.3.x-r8659/FL/Fl.H.orig fltk-1.3.x-r8659/FL/Fl.H
|
||||
--- fltk-1.3.x-r8659/FL/Fl.H.orig 2011-05-17 16:25:56.671744548 +0200
|
||||
+++ fltk-1.3.x-r8659/FL/Fl.H 2011-05-17 16:26:05.709101536 +0200
|
||||
@@ -108,6 +108,9 @@ typedef int (*Fl_Args_Handler)(int argc,
|
||||
\see Fl::event_dispatch(Fl_Event_Dispatch) */
|
||||
typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w);
|
||||
|
||||
+/** Signature of add_clipboard_notify functions passed as parameters */
|
||||
+typedef void (*Fl_Clipboard_Notify_Handler)(int source, void *data);
|
||||
+
|
||||
/** @} */ /* group callback_functions */
|
||||
|
||||
|
||||
@@ -744,6 +747,19 @@ public:
|
||||
*/
|
||||
static void paste(Fl_Widget &receiver, int source /*=0*/); // platform dependent
|
||||
/**
|
||||
+ FLTK will call the registered callback whenever there is a change to the
|
||||
+ selection buffer or the clipboard. The source argument indicates which
|
||||
+ of the two has changed. Only changes by other applications are reported.
|
||||
+ \note Some systems require polling to monitor the clipboard and may
|
||||
+ therefore have some delay in detecting changes.
|
||||
+ */
|
||||
+ static void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data);
|
||||
+ /**
|
||||
+ Stop calling the specified callback when there are changes to the selection
|
||||
+ buffer or the clipboard.
|
||||
+ */
|
||||
+ static void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h);
|
||||
+ /**
|
||||
Initiate a Drag And Drop operation. The selection buffer should be
|
||||
filled with relevant data before calling this method. FLTK will
|
||||
then initiate the system wide drag and drop handling. Dropped data
|
||||
diff -up fltk-1.3.x-r8659/src/Fl.cxx.orig fltk-1.3.x-r8659/src/Fl.cxx
|
||||
--- fltk-1.3.x-r8659/src/Fl.cxx.orig 2011-05-18 15:20:26.667291459 +0200
|
||||
+++ fltk-1.3.x-r8659/src/Fl.cxx 2011-05-18 16:31:15.522026086 +0200
|
||||
@@ -430,6 +430,69 @@ static char in_idle;
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
+// Clipboard notifications
|
||||
+
|
||||
+struct Clipboard_Notify {
|
||||
+ Fl_Clipboard_Notify_Handler handler;
|
||||
+ void *data;
|
||||
+ struct Clipboard_Notify *next;
|
||||
+};
|
||||
+
|
||||
+static struct Clipboard_Notify *clip_notify_list = NULL;
|
||||
+
|
||||
+extern void fl_clipboard_notify_change(); // in Fl_<platform>.cxx
|
||||
+
|
||||
+void Fl::add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data) {
|
||||
+ struct Clipboard_Notify *node;
|
||||
+
|
||||
+ remove_clipboard_notify(h);
|
||||
+
|
||||
+ node = new Clipboard_Notify;
|
||||
+
|
||||
+ node->handler = h;
|
||||
+ node->data = data;
|
||||
+ node->next = clip_notify_list;
|
||||
+
|
||||
+ clip_notify_list = node;
|
||||
+
|
||||
+ fl_clipboard_notify_change();
|
||||
+}
|
||||
+
|
||||
+void Fl::remove_clipboard_notify(Fl_Clipboard_Notify_Handler h) {
|
||||
+ struct Clipboard_Notify *node, **prev;
|
||||
+
|
||||
+ node = clip_notify_list;
|
||||
+ prev = &clip_notify_list;
|
||||
+ while (node != NULL) {
|
||||
+ if (node->handler == h) {
|
||||
+ *prev = node->next;
|
||||
+ delete node;
|
||||
+
|
||||
+ fl_clipboard_notify_change();
|
||||
+
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ prev = &node->next;
|
||||
+ node = node->next;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+bool fl_clipboard_notify_empty(void) {
|
||||
+ return clip_notify_list == NULL;
|
||||
+}
|
||||
+
|
||||
+void fl_trigger_clipboard_notify(int source) {
|
||||
+ struct Clipboard_Notify *node;
|
||||
+
|
||||
+ node = clip_notify_list;
|
||||
+ while (node != NULL) {
|
||||
+ node->handler(source, node->data);
|
||||
+ node = node->next;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+////////////////////////////////////////////////////////////////
|
||||
// wait/run/check/ready:
|
||||
|
||||
void (*Fl::idle)(); // see Fl::add_idle.cxx for the add/remove functions
|
||||
131
contrib/packages/rpm/el6/SOURCES/fltk-1.3.x-screen_num.patch
Normal file
131
contrib/packages/rpm/el6/SOURCES/fltk-1.3.x-screen_num.patch
Normal file
@@ -0,0 +1,131 @@
|
||||
diff -up fltk-1.3.0r9619/FL/Fl.H.screen_num fltk-1.3.0r9619/FL/Fl.H
|
||||
--- fltk-1.3.0r9619/FL/Fl.H.screen_num 2012-07-03 13:49:28.663085580 +0200
|
||||
+++ fltk-1.3.0r9619/FL/Fl.H 2012-07-03 13:49:28.731084402 +0200
|
||||
@@ -806,6 +806,8 @@ public:
|
||||
static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
|
||||
static void screen_xywh(int &X, int &Y, int &W, int &H, int n);
|
||||
static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh);
|
||||
+ static int screen_num(int x, int y);
|
||||
+ static int screen_num(int x, int y, int w, int h);
|
||||
static void screen_dpi(float &h, float &v, int n=0);
|
||||
static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my);
|
||||
static void screen_work_area(int &X, int &Y, int &W, int &H, int n);
|
||||
diff -up fltk-1.3.0r9619/src/screen_xywh.cxx.screen_num fltk-1.3.0r9619/src/screen_xywh.cxx
|
||||
--- fltk-1.3.0r9619/src/screen_xywh.cxx.screen_num 2012-03-23 17:47:53.000000000 +0100
|
||||
+++ fltk-1.3.0r9619/src/screen_xywh.cxx 2012-07-03 13:58:01.947195396 +0200
|
||||
@@ -215,21 +215,6 @@ int Fl::screen_count() {
|
||||
return num_screens ? num_screens : 1;
|
||||
}
|
||||
|
||||
-static int find_screen_with_point(int mx, int my) {
|
||||
- int screen = 0;
|
||||
- if (num_screens < 0) screen_init();
|
||||
-
|
||||
- for (int i = 0; i < num_screens; i ++) {
|
||||
- int sx, sy, sw, sh;
|
||||
- Fl::screen_xywh(sx, sy, sw, sh, i);
|
||||
- if ((mx >= sx) && (mx < (sx+sw)) && (my >= sy) && (my < (sy+sh))) {
|
||||
- screen = i;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
- return screen;
|
||||
-}
|
||||
-
|
||||
/**
|
||||
Gets the bounding box of a screen
|
||||
that contains the specified screen position \p mx, \p my
|
||||
@@ -237,7 +222,7 @@ static int find_screen_with_point(int mx
|
||||
\param[in] mx, my the absolute screen position
|
||||
*/
|
||||
void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my) {
|
||||
- screen_xywh(X, Y, W, H, find_screen_with_point(mx, my));
|
||||
+ screen_xywh(X, Y, W, H, screen_num(mx, my));
|
||||
}
|
||||
|
||||
|
||||
@@ -248,7 +233,7 @@ void Fl::screen_xywh(int &X, int &Y, int
|
||||
\param[in] mx, my the absolute screen position
|
||||
*/
|
||||
void Fl::screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my) {
|
||||
- screen_work_area(X, Y, W, H, find_screen_with_point(mx, my));
|
||||
+ screen_work_area(X, Y, W, H, screen_num(mx, my));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -321,6 +306,38 @@ void Fl::screen_xywh(int &X, int &Y, int
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
+/**
|
||||
+ Gets the screen bounding rect for the screen
|
||||
+ which intersects the most with the rectangle
|
||||
+ defined by \p mx, \p my, \p mw, \p mh.
|
||||
+ \param[out] X,Y,W,H the corresponding screen bounding box
|
||||
+ \param[in] mx, my, mw, mh the rectangle to search for intersection with
|
||||
+ \see void screen_xywh(int &X, int &Y, int &W, int &H, int n)
|
||||
+ */
|
||||
+void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh) {
|
||||
+ screen_xywh(X, Y, W, H, screen_num(mx, my, mw, mh));
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ Gets the screen number of a screen
|
||||
+ that contains the specified screen position \p x, \p y
|
||||
+ \param[in] x, y the absolute screen position
|
||||
+*/
|
||||
+int Fl::screen_num(int x, int y) {
|
||||
+ int screen = 0;
|
||||
+ if (num_screens < 0) screen_init();
|
||||
+
|
||||
+ for (int i = 0; i < num_screens; i ++) {
|
||||
+ int sx, sy, sw, sh;
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, i);
|
||||
+ if ((x >= sx) && (x < (sx+sw)) && (y >= sy) && (y < (sy+sh))) {
|
||||
+ screen = i;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ return screen;
|
||||
+}
|
||||
+
|
||||
static inline float fl_intersection(int x1, int y1, int w1, int h1,
|
||||
int x2, int y2, int w2, int h2) {
|
||||
if(x1+w1 < x2 || x2+w2 < x1 || y1+h1 < y2 || y2+h2 < y1)
|
||||
@@ -333,30 +350,27 @@ static inline float fl_intersection(int
|
||||
}
|
||||
|
||||
/**
|
||||
- Gets the screen bounding rect for the screen
|
||||
+ Gets the screen number for the screen
|
||||
which intersects the most with the rectangle
|
||||
- defined by \p mx, \p my, \p mw, \p mh.
|
||||
- \param[out] X,Y,W,H the corresponding screen bounding box
|
||||
- \param[in] mx, my, mw, mh the rectangle to search for intersection with
|
||||
- \see void screen_xywh(int &X, int &Y, int &W, int &H, int n)
|
||||
+ defined by \p x, \p y, \p w, \p h.
|
||||
+ \param[in] x, y, w, h the rectangle to search for intersection with
|
||||
*/
|
||||
-void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh) {
|
||||
+int Fl::screen_num(int x, int y, int w, int h) {
|
||||
int best_screen = 0;
|
||||
float best_intersection = 0.;
|
||||
for(int i = 0; i < Fl::screen_count(); i++) {
|
||||
int sx, sy, sw, sh;
|
||||
Fl::screen_xywh(sx, sy, sw, sh, i);
|
||||
- float sintersection = fl_intersection(mx, my, mw, mh, sx, sy, sw, sh);
|
||||
+ float sintersection = fl_intersection(x, y, w, h, sx, sy, sw, sh);
|
||||
if(sintersection > best_intersection) {
|
||||
best_screen = i;
|
||||
best_intersection = sintersection;
|
||||
}
|
||||
}
|
||||
- screen_xywh(X, Y, W, H, best_screen);
|
||||
+ return best_screen;
|
||||
}
|
||||
|
||||
|
||||
-
|
||||
/**
|
||||
Gets the screen resolution in dots-per-inch for the given screen.
|
||||
\param[out] h, v horizontal and vertical resolution
|
||||
75
contrib/packages/rpm/el6/SOURCES/fltk-1_v2.3.0-modal.patch
Normal file
75
contrib/packages/rpm/el6/SOURCES/fltk-1_v2.3.0-modal.patch
Normal file
@@ -0,0 +1,75 @@
|
||||
diff -bur fltk-1.3.0r9619.org/src/Fl_cocoa.mm fltk-1.3.0r9619/src/Fl_cocoa.mm
|
||||
--- fltk-1.3.0r9619.org/src/Fl_cocoa.mm 2012-06-19 12:54:43.694231638 +0200
|
||||
+++ fltk-1.3.0r9619/src/Fl_cocoa.mm 2012-06-19 12:57:05.899048602 +0200
|
||||
@@ -697,12 +697,9 @@
|
||||
return NO; // prevent the caption to be redrawn as active on click
|
||||
// when another modal window is currently the key win
|
||||
|
||||
- return !(w->tooltip_window() || w->menu_window());
|
||||
+ return !w->tooltip_window();
|
||||
}
|
||||
|
||||
-// TODO see if we really need a canBecomeMainWindow ...
|
||||
-#if 0
|
||||
-
|
||||
- (BOOL)canBecomeMainWindow
|
||||
{
|
||||
if (Fl::modal_ && (Fl::modal_ != w))
|
||||
@@ -711,7 +708,6 @@
|
||||
|
||||
return !(w->tooltip_window() || w->menu_window());
|
||||
}
|
||||
-#endif
|
||||
|
||||
@end
|
||||
|
||||
diff -bur fltk-1.3.0r9619.org/src/Fl_win32.cxx fltk-1.3.0r9619/src/Fl_win32.cxx
|
||||
--- fltk-1.3.0r9619.org/src/Fl_win32.cxx 2012-06-19 12:54:43.696231735 +0200
|
||||
+++ fltk-1.3.0r9619/src/Fl_win32.cxx 2012-06-19 12:54:43.803236862 +0200
|
||||
@@ -1065,6 +1065,10 @@
|
||||
break;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
+ if ((Fl::modal_) && (Fl::modal_ != window)) {
|
||||
+ SetFocus(fl_xid(Fl::modal_));
|
||||
+ return 0;
|
||||
+ }
|
||||
Fl::handle(FL_FOCUS, window);
|
||||
break;
|
||||
|
||||
@@ -1826,6 +1830,11 @@
|
||||
Fl::e_number = old_event;
|
||||
w->redraw(); // force draw to happen
|
||||
}
|
||||
+
|
||||
+ // Needs to be done before ShowWindow() to get the correct behaviour
|
||||
+ // when we get WM_SETFOCUS.
|
||||
+ if (w->modal()) {Fl::modal_ = w; fl_fix_focus();}
|
||||
+
|
||||
// If we've captured the mouse, we dont want to activate any
|
||||
// other windows from the code, or we lose the capture.
|
||||
ShowWindow(x->xid, !showit ? SW_SHOWMINNOACTIVE :
|
||||
@@ -1843,7 +1852,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (w->modal()) {Fl::modal_ = w; fl_fix_focus();}
|
||||
return x;
|
||||
}
|
||||
|
||||
diff -bur fltk-1.3.0r9619.org/src/Fl_x.cxx fltk-1.3.0r9619/src/Fl_x.cxx
|
||||
--- fltk-1.3.0r9619.org/src/Fl_x.cxx 2012-06-19 12:54:43.697231783 +0200
|
||||
+++ fltk-1.3.0r9619/src/Fl_x.cxx 2012-06-19 12:54:43.804236911 +0200
|
||||
@@ -2101,6 +2101,12 @@
|
||||
while (wp->parent()) wp = wp->window();
|
||||
XSetTransientForHint(fl_display, xp->xid, fl_xid(wp));
|
||||
if (!wp->visible()) showit = 0; // guess that wm will not show it
|
||||
+ if (win->modal()) {
|
||||
+ Atom net_wm_state = XInternAtom (fl_display, "_NET_WM_STATE", 0);
|
||||
+ Atom net_wm_state_skip_taskbar = XInternAtom (fl_display, "_NET_WM_STATE_MODAL", 0);
|
||||
+ XChangeProperty (fl_display, xp->xid, net_wm_state, XA_ATOM, 32,
|
||||
+ PropModeAppend, (unsigned char*) &net_wm_state_skip_taskbar, 1);
|
||||
+ }
|
||||
}
|
||||
|
||||
// Make sure that borderless windows do not show in the task bar
|
||||
@@ -0,0 +1,44 @@
|
||||
diff -bur fltk-1.3.0r9619.org/src/Fl_cocoa.mm fltk-1.3.0r9619/src/Fl_cocoa.mm
|
||||
--- fltk-1.3.0r9619.org/src/Fl_cocoa.mm 2012-06-18 19:24:30.971688769 +0200
|
||||
+++ fltk-1.3.0r9619/src/Fl_cocoa.mm 2012-06-18 19:25:25.700310375 +0200
|
||||
@@ -1319,9 +1319,13 @@
|
||||
}
|
||||
@end
|
||||
|
||||
+static void clipboard_check(void);
|
||||
+
|
||||
@implementation FLApplication
|
||||
+ (void)sendEvent:(NSEvent *)theEvent
|
||||
{
|
||||
+ // update clipboard status
|
||||
+ clipboard_check();
|
||||
NSEventType type = [theEvent type];
|
||||
if (type == NSLeftMouseDown) {
|
||||
fl_lock_function();
|
||||
@@ -2790,6 +2794,26 @@
|
||||
PasteboardCreate(kPasteboardClipboard, &myPasteboard);
|
||||
}
|
||||
|
||||
+extern void fl_trigger_clipboard_notify(int source);
|
||||
+
|
||||
+void fl_clipboard_notify_change() {
|
||||
+ // No need to do anything here...
|
||||
+}
|
||||
+
|
||||
+static void clipboard_check(void)
|
||||
+{
|
||||
+ PasteboardSyncFlags flags;
|
||||
+
|
||||
+ allocatePasteboard();
|
||||
+ flags = PasteboardSynchronize(myPasteboard);
|
||||
+
|
||||
+ if (!(flags & kPasteboardModified))
|
||||
+ return;
|
||||
+ if (flags & kPasteboardClientIsOwner)
|
||||
+ return;
|
||||
+
|
||||
+ fl_trigger_clipboard_notify(1);
|
||||
+}
|
||||
|
||||
/*
|
||||
* create a selection
|
||||
@@ -0,0 +1,99 @@
|
||||
diff -ur fltk-1.3.0r9110.org/src/Fl.cxx fltk-1.3.0r9110/src/Fl.cxx
|
||||
--- fltk-1.3.0r9110.org/src/Fl.cxx 2012-06-17 19:47:09.988183253 +0200
|
||||
+++ fltk-1.3.0r9110/src/Fl.cxx 2012-06-17 19:47:10.127189919 +0200
|
||||
@@ -1421,6 +1421,7 @@
|
||||
// hide() destroys the X window, it does not do unmap!
|
||||
|
||||
#if defined(WIN32)
|
||||
+extern void fl_clipboard_notify_untarget(HWND wnd);
|
||||
extern void fl_update_clipboard(void);
|
||||
#elif USE_XFT
|
||||
extern void fl_destroy_xft_draw(Window);
|
||||
@@ -1471,6 +1472,8 @@
|
||||
// to destroy the window that owns the selection.
|
||||
if (GetClipboardOwner()==ip->xid)
|
||||
fl_update_clipboard();
|
||||
+ // Make sure we unlink this window from the clipboard chain
|
||||
+ fl_clipboard_notify_untarget(ip->xid);
|
||||
// Send a message to myself so that I'll get out of the event loop...
|
||||
PostMessage(ip->xid, WM_APP, 0, 0);
|
||||
if (ip->private_dc) fl_release_dc(ip->xid, ip->private_dc);
|
||||
diff -ur fltk-1.3.0r9110.org/src/Fl_win32.cxx fltk-1.3.0r9110/src/Fl_win32.cxx
|
||||
--- fltk-1.3.0r9110.org/src/Fl_win32.cxx 2012-06-17 19:47:09.987183205 +0200
|
||||
+++ fltk-1.3.0r9110/src/Fl_win32.cxx 2012-06-17 19:47:19.069618739 +0200
|
||||
@@ -646,6 +646,38 @@
|
||||
}
|
||||
}
|
||||
|
||||
+static HWND clipboard_wnd = 0;
|
||||
+static HWND next_clipboard_wnd = 0;
|
||||
+
|
||||
+static bool initial_clipboard = true;
|
||||
+
|
||||
+void fl_clipboard_notify_change() {
|
||||
+ // No need to do anything here...
|
||||
+}
|
||||
+
|
||||
+void fl_clipboard_notify_target(HWND wnd) {
|
||||
+ if (clipboard_wnd)
|
||||
+ return;
|
||||
+
|
||||
+ // We get one fake WM_DRAWCLIPBOARD immediately, which we therefore
|
||||
+ // need to ignore.
|
||||
+ initial_clipboard = true;
|
||||
+
|
||||
+ clipboard_wnd = wnd;
|
||||
+ next_clipboard_wnd = SetClipboardViewer(wnd);
|
||||
+}
|
||||
+
|
||||
+void fl_clipboard_notify_untarget(HWND wnd) {
|
||||
+ if (wnd != clipboard_wnd)
|
||||
+ return;
|
||||
+
|
||||
+ ChangeClipboardChain(wnd, next_clipboard_wnd);
|
||||
+ clipboard_wnd = next_clipboard_wnd = 0;
|
||||
+
|
||||
+ if (Fl::first_window())
|
||||
+ fl_clipboard_notify_target(fl_xid(Fl::first_window()));
|
||||
+}
|
||||
+
|
||||
////////////////////////////////////////////////////////////////
|
||||
char fl_is_ime = 0;
|
||||
void fl_get_codepage()
|
||||
@@ -1327,6 +1359,27 @@
|
||||
Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
|
||||
return 0;
|
||||
|
||||
+ case WM_CHANGECBCHAIN:
|
||||
+ if ((hWnd == clipboard_wnd) &&
|
||||
+ (next_clipboard_wnd == (HWND)wParam)) {
|
||||
+ next_clipboard_wnd = (HWND)lParam;
|
||||
+ return 0;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case WM_DRAWCLIPBOARD:
|
||||
+ // When the clipboard moves between two FLTK windows,
|
||||
+ // fl_i_own_selection will temporarily be false as we are
|
||||
+ // processing this message. Hence the need to use fl_find().
|
||||
+ if (!initial_clipboard && !fl_find(GetClipboardOwner()))
|
||||
+ fl_trigger_clipboard_notify(1);
|
||||
+ initial_clipboard = false;
|
||||
+
|
||||
+ if (next_clipboard_wnd)
|
||||
+ SendMessage(next_clipboard_wnd, WM_DRAWCLIPBOARD, wParam, lParam);
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
default:
|
||||
if (Fl::handle(0,0)) return 0;
|
||||
break;
|
||||
@@ -1685,6 +1738,8 @@
|
||||
x->next = Fl_X::first;
|
||||
Fl_X::first = x;
|
||||
|
||||
+ fl_clipboard_notify_target(x->xid);
|
||||
+
|
||||
x->wait_for_expose = 1;
|
||||
if (fl_show_iconic) {showit = 0; fl_show_iconic = 0;}
|
||||
if (showit) {
|
||||
645
contrib/packages/rpm/el6/SOURCES/fltk-1_v3.3.0-icons.patch
Normal file
645
contrib/packages/rpm/el6/SOURCES/fltk-1_v3.3.0-icons.patch
Normal file
@@ -0,0 +1,645 @@
|
||||
diff -ur fltk-1.3.2.org/FL/Fl_Window.H fltk-1.3.2/FL/Fl_Window.H
|
||||
--- fltk-1.3.2.org/FL/Fl_Window.H 2013-01-16 10:49:40.904228200 +0100
|
||||
+++ fltk-1.3.2/FL/Fl_Window.H 2013-01-16 10:49:55.554353925 +0100
|
||||
@@ -22,6 +22,10 @@
|
||||
#ifndef Fl_Window_H
|
||||
#define Fl_Window_H
|
||||
|
||||
+#ifdef WIN32
|
||||
+#include <windows.h>
|
||||
+#endif
|
||||
+
|
||||
#include "Fl_Group.H"
|
||||
|
||||
#define FL_WINDOW 0xF0 ///< window type id all subclasses have type() >= this
|
||||
@@ -73,9 +77,19 @@
|
||||
friend class Fl_X;
|
||||
Fl_X *i; // points at the system-specific stuff
|
||||
|
||||
+ struct icon_data {
|
||||
+ const void *legacy_icon;
|
||||
+ Fl_RGB_Image **icons;
|
||||
+ int count;
|
||||
+#ifdef WIN32
|
||||
+ HICON big_icon;
|
||||
+ HICON small_icon;
|
||||
+#endif
|
||||
+ };
|
||||
+
|
||||
const char* iconlabel_;
|
||||
char* xclass_;
|
||||
- const void* icon_;
|
||||
+ struct icon_data *icon_;
|
||||
// size_range stuff:
|
||||
int minw, minh, maxw, maxh;
|
||||
int dw, dh, aspect;
|
||||
@@ -121,6 +135,8 @@
|
||||
*/
|
||||
int force_position() const { return ((flags() & FORCE_POSITION)?1:0); }
|
||||
|
||||
+ void free_icons();
|
||||
+
|
||||
public:
|
||||
|
||||
/**
|
||||
@@ -350,6 +366,18 @@
|
||||
static const char *default_xclass();
|
||||
const char* xclass() const;
|
||||
void xclass(const char* c);
|
||||
+
|
||||
+ static void default_icon(const Fl_RGB_Image*);
|
||||
+ static void default_icons(const Fl_RGB_Image*[], int);
|
||||
+ void icon(const Fl_RGB_Image*);
|
||||
+ void icons(const Fl_RGB_Image*[], int);
|
||||
+
|
||||
+#ifdef WIN32
|
||||
+ static void default_icons(HICON big_icon, HICON small_icon);
|
||||
+ void icons(HICON big_icon, HICON small_icon);
|
||||
+#endif
|
||||
+
|
||||
+ /* for legacy compatibility */
|
||||
const void* icon() const;
|
||||
void icon(const void * ic);
|
||||
|
||||
diff -ur fltk-1.3.2.org/FL/mac.H fltk-1.3.2/FL/mac.H
|
||||
--- fltk-1.3.2.org/FL/mac.H 2013-01-16 10:49:40.904228200 +0100
|
||||
+++ fltk-1.3.2/FL/mac.H 2013-01-16 10:49:55.554353925 +0100
|
||||
@@ -120,6 +120,9 @@
|
||||
void collapse(void);
|
||||
WindowRef window_ref(void);
|
||||
void set_key_window(void);
|
||||
+ // OS X doesn't have per window icons
|
||||
+ static void set_default_icons(const Fl_RGB_Image*[], int) {};
|
||||
+ void set_icons() {};
|
||||
int set_cursor(Fl_Cursor);
|
||||
int set_cursor(const Fl_RGB_Image*, int, int);
|
||||
static CGImageRef CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, int h);
|
||||
diff -ur fltk-1.3.2.org/FL/win32.H fltk-1.3.2/FL/win32.H
|
||||
--- fltk-1.3.2.org/FL/win32.H 2013-01-16 10:49:40.904228200 +0100
|
||||
+++ fltk-1.3.2/FL/win32.H 2013-01-16 10:49:55.555355617 +0100
|
||||
@@ -84,6 +84,9 @@
|
||||
void flush() {w->flush();}
|
||||
void set_minmax(LPMINMAXINFO minmax);
|
||||
void mapraise();
|
||||
+ static void set_default_icons(const Fl_RGB_Image*[], int);
|
||||
+ static void set_default_icons(HICON, HICON);
|
||||
+ void set_icons();
|
||||
int set_cursor(Fl_Cursor);
|
||||
int set_cursor(const Fl_RGB_Image*, int, int);
|
||||
static Fl_X* make(Fl_Window*);
|
||||
diff -ur fltk-1.3.2.org/FL/x.H fltk-1.3.2/FL/x.H
|
||||
--- fltk-1.3.2.org/FL/x.H 2013-01-16 10:49:40.904228200 +0100
|
||||
+++ fltk-1.3.2/FL/x.H 2013-01-16 10:49:55.555355617 +0100
|
||||
@@ -154,6 +154,8 @@
|
||||
static Fl_X* i(const Fl_Window* wi) {return wi->i;}
|
||||
void setwindow(Fl_Window* wi) {w=wi; wi->i=this;}
|
||||
void sendxjunk();
|
||||
+ static void set_default_icons(const Fl_RGB_Image*[], int);
|
||||
+ void set_icons();
|
||||
int set_cursor(Fl_Cursor);
|
||||
int set_cursor(const Fl_RGB_Image*, int, int);
|
||||
static void make_xid(Fl_Window*,XVisualInfo* =fl_visual, Colormap=fl_colormap);
|
||||
diff -ur fltk-1.3.2.org/src/Fl.cxx fltk-1.3.2/src/Fl.cxx
|
||||
--- fltk-1.3.2.org/src/Fl.cxx 2013-01-16 10:49:40.895228113 +0100
|
||||
+++ fltk-1.3.2/src/Fl.cxx 2013-01-16 10:49:55.556137979 +0100
|
||||
@@ -1530,6 +1530,8 @@
|
||||
if (xclass_) {
|
||||
free(xclass_);
|
||||
}
|
||||
+ free_icons();
|
||||
+ delete icon_;
|
||||
}
|
||||
|
||||
// FL_SHOW and FL_HIDE are called whenever the visibility of this widget
|
||||
diff -ur fltk-1.3.2.org/src/Fl_win32.cxx fltk-1.3.2/src/Fl_win32.cxx
|
||||
--- fltk-1.3.2.org/src/Fl_win32.cxx 2013-01-16 10:49:40.911227539 +0100
|
||||
+++ fltk-1.3.2/src/Fl_win32.cxx 2013-01-16 10:49:55.556137979 +0100
|
||||
@@ -1804,6 +1804,8 @@
|
||||
);
|
||||
if (lab) free(lab);
|
||||
|
||||
+ x->set_icons();
|
||||
+
|
||||
if (w->fullscreen_active()) {
|
||||
/* We need to make sure that the fullscreen is created on the
|
||||
default monitor, ie the desktop where the shortcut is located
|
||||
@@ -2034,71 +2036,19 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
-#ifndef IDC_HAND
|
||||
-# define IDC_HAND MAKEINTRESOURCE(32649)
|
||||
-#endif // !IDC_HAND
|
||||
-
|
||||
-int Fl_X::set_cursor(Fl_Cursor c) {
|
||||
- LPSTR n;
|
||||
- HCURSOR new_cursor;
|
||||
-
|
||||
- if (c == FL_CURSOR_NONE)
|
||||
- new_cursor = NULL;
|
||||
- else {
|
||||
- switch (c) {
|
||||
- case FL_CURSOR_ARROW: n = IDC_ARROW; break;
|
||||
- case FL_CURSOR_CROSS: n = IDC_CROSS; break;
|
||||
- case FL_CURSOR_WAIT: n = IDC_WAIT; break;
|
||||
- case FL_CURSOR_INSERT: n = IDC_IBEAM; break;
|
||||
- case FL_CURSOR_HAND: n = IDC_HAND; break;
|
||||
- case FL_CURSOR_HELP: n = IDC_HELP; break;
|
||||
- case FL_CURSOR_MOVE: n = IDC_SIZEALL; break;
|
||||
- case FL_CURSOR_N:
|
||||
- case FL_CURSOR_S:
|
||||
- // FIXME: Should probably have fallbacks for these instead
|
||||
- case FL_CURSOR_NS: n = IDC_SIZENS; break;
|
||||
- case FL_CURSOR_NE:
|
||||
- case FL_CURSOR_SW:
|
||||
- // FIXME: Dito.
|
||||
- case FL_CURSOR_NESW: n = IDC_SIZENESW; break;
|
||||
- case FL_CURSOR_E:
|
||||
- case FL_CURSOR_W:
|
||||
- // FIXME: Dito.
|
||||
- case FL_CURSOR_WE: n = IDC_SIZEWE; break;
|
||||
- case FL_CURSOR_SE:
|
||||
- case FL_CURSOR_NW:
|
||||
- // FIXME: Dito.
|
||||
- case FL_CURSOR_NWSE: n = IDC_SIZENWSE; break;
|
||||
- default:
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- new_cursor = LoadCursor(NULL, n);
|
||||
- if (new_cursor == NULL)
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- if ((cursor != NULL) && custom_cursor)
|
||||
- DestroyIcon(cursor);
|
||||
-
|
||||
- cursor = new_cursor;
|
||||
- custom_cursor = 0;
|
||||
-
|
||||
- SetCursor(cursor);
|
||||
-
|
||||
- return 1;
|
||||
-}
|
||||
-
|
||||
-int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
|
||||
+static HICON image_to_icon(const Fl_RGB_Image *image, bool is_icon=true,
|
||||
+ int hotx = 0, int hoty = 0) {
|
||||
BITMAPV5HEADER bi;
|
||||
HBITMAP bitmap, mask;
|
||||
DWORD *bits;
|
||||
- HCURSOR new_cursor;
|
||||
+ HICON icon;
|
||||
|
||||
+ if (!is_icon) {
|
||||
if ((hotx < 0) || (hotx >= image->w()))
|
||||
- return 0;
|
||||
+ return NULL;
|
||||
if ((hoty < 0) || (hoty >= image->h()))
|
||||
- return 0;
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
memset(&bi, 0, sizeof(BITMAPV5HEADER));
|
||||
|
||||
@@ -2120,7 +2070,7 @@
|
||||
ReleaseDC(NULL, hdc);
|
||||
|
||||
if (bits == NULL)
|
||||
- return 0;
|
||||
+ return NULL;
|
||||
|
||||
const uchar *i = (const uchar*)*image->data();
|
||||
for (int y = 0;y < image->h();y++) {
|
||||
@@ -2149,22 +2099,206 @@
|
||||
mask = CreateBitmap(image->w(),image->h(),1,1,NULL);
|
||||
if (mask == NULL) {
|
||||
DeleteObject(bitmap);
|
||||
- return 0;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
ICONINFO ii;
|
||||
|
||||
- ii.fIcon = FALSE;
|
||||
+ ii.fIcon = is_icon;
|
||||
ii.xHotspot = hotx;
|
||||
ii.yHotspot = hoty;
|
||||
ii.hbmMask = mask;
|
||||
ii.hbmColor = bitmap;
|
||||
|
||||
- new_cursor = CreateIconIndirect(&ii);
|
||||
+ icon = CreateIconIndirect(&ii);
|
||||
|
||||
DeleteObject(bitmap);
|
||||
DeleteObject(mask);
|
||||
|
||||
+ if (icon == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ return icon;
|
||||
+}
|
||||
+
|
||||
+////////////////////////////////////////////////////////////////
|
||||
+
|
||||
+static HICON default_big_icon = NULL;
|
||||
+static HICON default_small_icon = NULL;
|
||||
+
|
||||
+const Fl_RGB_Image *find_best_icon(int ideal_width,
|
||||
+ const Fl_RGB_Image *icons[], int count) {
|
||||
+ const Fl_RGB_Image *best;
|
||||
+
|
||||
+ best = NULL;
|
||||
+
|
||||
+ for (int i = 0;i < count;i++) {
|
||||
+ if (best == NULL)
|
||||
+ best = icons[i];
|
||||
+ else {
|
||||
+ if (best->w() < ideal_width) {
|
||||
+ if (icons[i]->w() > best->w())
|
||||
+ best = icons[i];
|
||||
+ } else {
|
||||
+ if ((icons[i]->w() >= ideal_width) &&
|
||||
+ (icons[i]->w() < best->w()))
|
||||
+ best = icons[i];
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return best;
|
||||
+}
|
||||
+
|
||||
+void Fl_X::set_default_icons(const Fl_RGB_Image *icons[], int count) {
|
||||
+ const Fl_RGB_Image *best_big, *best_small;
|
||||
+
|
||||
+ if (default_big_icon != NULL)
|
||||
+ DestroyIcon(default_big_icon);
|
||||
+ if (default_small_icon != NULL)
|
||||
+ DestroyIcon(default_small_icon);
|
||||
+
|
||||
+ best_big = find_best_icon(GetSystemMetrics(SM_CXICON), icons, count);
|
||||
+ best_small = find_best_icon(GetSystemMetrics(SM_CXSMICON), icons, count);
|
||||
+
|
||||
+ if (best_big != NULL)
|
||||
+ default_big_icon = image_to_icon(best_big);
|
||||
+ else
|
||||
+ default_big_icon = NULL;
|
||||
+
|
||||
+ if (best_small != NULL)
|
||||
+ default_small_icon = image_to_icon(best_small);
|
||||
+ else
|
||||
+ default_small_icon = NULL;
|
||||
+}
|
||||
+
|
||||
+void Fl_X::set_default_icons(HICON big_icon, HICON small_icon) {
|
||||
+ if (default_big_icon != NULL)
|
||||
+ DestroyIcon(default_big_icon);
|
||||
+ if (default_small_icon != NULL)
|
||||
+ DestroyIcon(default_small_icon);
|
||||
+
|
||||
+ if (big_icon != NULL)
|
||||
+ default_big_icon = CopyIcon(big_icon);
|
||||
+ if (small_icon != NULL)
|
||||
+ default_small_icon = CopyIcon(small_icon);
|
||||
+}
|
||||
+
|
||||
+void Fl_X::set_icons() {
|
||||
+ HICON big_icon, small_icon;
|
||||
+
|
||||
+ big_icon = NULL;
|
||||
+ small_icon = NULL;
|
||||
+
|
||||
+ if (w->icon_->count) {
|
||||
+ const Fl_RGB_Image *best_big, *best_small;
|
||||
+
|
||||
+ best_big = find_best_icon(GetSystemMetrics(SM_CXICON),
|
||||
+ (const Fl_RGB_Image **)w->icon_->icons,
|
||||
+ w->icon_->count);
|
||||
+ best_small = find_best_icon(GetSystemMetrics(SM_CXSMICON),
|
||||
+ (const Fl_RGB_Image **)w->icon_->icons,
|
||||
+ w->icon_->count);
|
||||
+
|
||||
+ if (best_big != NULL)
|
||||
+ big_icon = image_to_icon(best_big);
|
||||
+ if (best_small != NULL)
|
||||
+ small_icon = image_to_icon(best_small);
|
||||
+ } else {
|
||||
+ big_icon = default_big_icon;
|
||||
+ small_icon = default_small_icon;
|
||||
+ }
|
||||
+
|
||||
+ if (big_icon != NULL)
|
||||
+ SendMessage(xid, WM_SETICON, ICON_BIG, (LPARAM)big_icon);
|
||||
+ if (small_icon != NULL)
|
||||
+ SendMessage(xid, WM_SETICON, ICON_SMALL, (LPARAM)small_icon);
|
||||
+
|
||||
+ if (w->icon_->count) {
|
||||
+ if (big_icon != NULL)
|
||||
+ DestroyIcon(big_icon);
|
||||
+ if (small_icon != NULL)
|
||||
+ DestroyIcon(small_icon);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void Fl_Window::default_icons(HICON big_icon, HICON small_icon) {
|
||||
+ Fl_X::set_default_icons(big_icon, small_icon);
|
||||
+}
|
||||
+
|
||||
+void Fl_Window::icons(HICON big_icon, HICON small_icon) {
|
||||
+ free_icons();
|
||||
+
|
||||
+ if (big_icon != NULL)
|
||||
+ icon_->big_icon = CopyIcon(big_icon);
|
||||
+ if (small_icon != NULL)
|
||||
+ icon_->small_icon = CopyIcon(small_icon);
|
||||
+
|
||||
+ if (i)
|
||||
+ i->set_icons();
|
||||
+}
|
||||
+
|
||||
+////////////////////////////////////////////////////////////////
|
||||
+
|
||||
+#ifndef IDC_HAND
|
||||
+# define IDC_HAND MAKEINTRESOURCE(32649)
|
||||
+#endif // !IDC_HAND
|
||||
+
|
||||
+int Fl_X::set_cursor(Fl_Cursor c) {
|
||||
+ LPSTR n;
|
||||
+ HCURSOR new_cursor;
|
||||
+
|
||||
+ if (c == FL_CURSOR_NONE)
|
||||
+ new_cursor = NULL;
|
||||
+ else {
|
||||
+ switch (c) {
|
||||
+ case FL_CURSOR_ARROW: n = IDC_ARROW; break;
|
||||
+ case FL_CURSOR_CROSS: n = IDC_CROSS; break;
|
||||
+ case FL_CURSOR_WAIT: n = IDC_WAIT; break;
|
||||
+ case FL_CURSOR_INSERT: n = IDC_IBEAM; break;
|
||||
+ case FL_CURSOR_HAND: n = IDC_HAND; break;
|
||||
+ case FL_CURSOR_HELP: n = IDC_HELP; break;
|
||||
+ case FL_CURSOR_MOVE: n = IDC_SIZEALL; break;
|
||||
+ case FL_CURSOR_N:
|
||||
+ case FL_CURSOR_S:
|
||||
+ // FIXME: Should probably have fallbacks for these instead
|
||||
+ case FL_CURSOR_NS: n = IDC_SIZENS; break;
|
||||
+ case FL_CURSOR_NE:
|
||||
+ case FL_CURSOR_SW:
|
||||
+ // FIXME: Dito.
|
||||
+ case FL_CURSOR_NESW: n = IDC_SIZENESW; break;
|
||||
+ case FL_CURSOR_E:
|
||||
+ case FL_CURSOR_W:
|
||||
+ // FIXME: Dito.
|
||||
+ case FL_CURSOR_WE: n = IDC_SIZEWE; break;
|
||||
+ case FL_CURSOR_SE:
|
||||
+ case FL_CURSOR_NW:
|
||||
+ // FIXME: Dito.
|
||||
+ case FL_CURSOR_NWSE: n = IDC_SIZENWSE; break;
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ new_cursor = LoadCursor(NULL, n);
|
||||
+ if (new_cursor == NULL)
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if ((cursor != NULL) && custom_cursor)
|
||||
+ DestroyIcon(cursor);
|
||||
+
|
||||
+ cursor = new_cursor;
|
||||
+ custom_cursor = 0;
|
||||
+
|
||||
+ SetCursor(cursor);
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
|
||||
+ HCURSOR new_cursor;
|
||||
+
|
||||
+ new_cursor = image_to_icon(image, false, hotx, hoty);
|
||||
if (new_cursor == NULL)
|
||||
return 0;
|
||||
|
||||
diff -ur fltk-1.3.2.org/src/Fl_Window.cxx fltk-1.3.2/src/Fl_Window.cxx
|
||||
--- fltk-1.3.2.org/src/Fl_Window.cxx 2013-01-16 10:49:40.908130903 +0100
|
||||
+++ fltk-1.3.2/src/Fl_Window.cxx 2013-01-16 10:49:55.557353865 +0100
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <config.h>
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/x.H>
|
||||
+#include <FL/Fl_RGB_Image.H>
|
||||
#include <FL/Fl_Window.H>
|
||||
#include <stdlib.h>
|
||||
#include "flstring.h"
|
||||
@@ -45,7 +46,8 @@
|
||||
}
|
||||
i = 0;
|
||||
xclass_ = 0;
|
||||
- icon_ = 0;
|
||||
+ icon_ = new icon_data;
|
||||
+ memset(icon_, 0, sizeof(*icon_));
|
||||
iconlabel_ = 0;
|
||||
resizable(0);
|
||||
size_range_set = 0;
|
||||
@@ -264,16 +266,68 @@
|
||||
}
|
||||
}
|
||||
|
||||
+void Fl_Window::default_icon(const Fl_RGB_Image *icon) {
|
||||
+ default_icons(&icon, 1);
|
||||
+}
|
||||
+
|
||||
+void Fl_Window::default_icons(const Fl_RGB_Image **icons, int count) {
|
||||
+ Fl_X::set_default_icons(icons, count);
|
||||
+}
|
||||
+
|
||||
+void Fl_Window::icon(const Fl_RGB_Image *icon) {
|
||||
+ icons(&icon, 1);
|
||||
+}
|
||||
+
|
||||
+void Fl_Window::icons(const Fl_RGB_Image **icons, int count) {
|
||||
+ free_icons();
|
||||
+
|
||||
+ if (count > 0) {
|
||||
+ icon_->icons = new Fl_RGB_Image*[count];
|
||||
+ icon_->count = count;
|
||||
+ // FIXME: Fl_RGB_Image lacks const modifiers on methods
|
||||
+ for (int i = 0;i < count;i++)
|
||||
+ icon_->icons[i] = (Fl_RGB_Image*)((Fl_RGB_Image*)icons[i])->copy();
|
||||
+ }
|
||||
+
|
||||
+ if (i)
|
||||
+ i->set_icons();
|
||||
+}
|
||||
+
|
||||
/** Gets the current icon window target dependent data. */
|
||||
const void *Fl_Window::icon() const {
|
||||
- return icon_;
|
||||
+ return icon_->legacy_icon;
|
||||
}
|
||||
|
||||
/** Sets the current icon window target dependent data. */
|
||||
void Fl_Window::icon(const void * ic) {
|
||||
- icon_ = ic;
|
||||
+ free_icons();
|
||||
+ icon_->legacy_icon = ic;
|
||||
}
|
||||
|
||||
+void Fl_Window::free_icons() {
|
||||
+ int i;
|
||||
+
|
||||
+ icon_->legacy_icon = 0L;
|
||||
+
|
||||
+ if (icon_->icons) {
|
||||
+ for (i = 0;i < icon_->count;i++)
|
||||
+ delete icon_->icons[i];
|
||||
+ delete [] icon_->icons;
|
||||
+ icon_->icons = 0L;
|
||||
+ }
|
||||
+
|
||||
+ icon_->count = 0;
|
||||
+
|
||||
+#ifdef WIN32
|
||||
+ if (icon_->big_icon)
|
||||
+ DestroyIcon(icon_->big_icon);
|
||||
+ if (icon_->small_icon)
|
||||
+ DestroyIcon(icon_->small_icon);
|
||||
+
|
||||
+ icon_->big_icon = NULL;
|
||||
+ icon_->small_icon = NULL;
|
||||
+#endif
|
||||
+}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Window.cxx 9706 2012-11-06 20:46:14Z matt $".
|
||||
diff -ur fltk-1.3.2.org/src/Fl_x.cxx fltk-1.3.2/src/Fl_x.cxx
|
||||
--- fltk-1.3.2.org/src/Fl_x.cxx 2013-01-16 10:49:40.912227213 +0100
|
||||
+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-16 10:49:55.558137113 +0100
|
||||
@@ -345,6 +345,7 @@
|
||||
Atom fl_NET_WM_STATE;
|
||||
Atom fl_NET_WM_STATE_FULLSCREEN;
|
||||
Atom fl_NET_WORKAREA;
|
||||
+Atom fl_NET_WM_ICON;
|
||||
|
||||
/*
|
||||
X defines 32-bit-entities to have a format value of max. 32,
|
||||
@@ -709,6 +710,7 @@
|
||||
fl_NET_WM_STATE = XInternAtom(d, "_NET_WM_STATE", 0);
|
||||
fl_NET_WM_STATE_FULLSCREEN = XInternAtom(d, "_NET_WM_STATE_FULLSCREEN", 0);
|
||||
fl_NET_WORKAREA = XInternAtom(d, "_NET_WORKAREA", 0);
|
||||
+ fl_NET_WM_ICON = XInternAtom(d, "_NET_WM_ICON", 0);
|
||||
|
||||
if (sizeof(Atom) < 4)
|
||||
atom_bits = sizeof(Atom) * 8;
|
||||
@@ -2138,12 +2140,14 @@
|
||||
fl_show_iconic = 0;
|
||||
showit = 0;
|
||||
}
|
||||
- if (win->icon()) {
|
||||
- hints->icon_pixmap = (Pixmap)win->icon();
|
||||
+ if (win->icon_->legacy_icon) {
|
||||
+ hints->icon_pixmap = (Pixmap)win->icon_->legacy_icon;
|
||||
hints->flags |= IconPixmapHint;
|
||||
}
|
||||
XSetWMHints(fl_display, xp->xid, hints);
|
||||
XFree(hints);
|
||||
+
|
||||
+ xp->set_icons();
|
||||
}
|
||||
|
||||
// set the window type for menu and tooltip windows to avoid animations (compiz)
|
||||
@@ -2263,6 +2267,93 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
+static unsigned long *default_net_wm_icons = 0L;
|
||||
+static size_t default_net_wm_icons_size = 0;
|
||||
+
|
||||
+void icons_to_property(const Fl_RGB_Image *icons[], int count,
|
||||
+ unsigned long **property, size_t *len) {
|
||||
+ size_t sz;
|
||||
+ unsigned long *data;
|
||||
+
|
||||
+ sz = 0;
|
||||
+ for (int i = 0;i < count;i++)
|
||||
+ sz += 2 + icons[i]->w() * icons[i]->h();
|
||||
+
|
||||
+ // FIXME: Might want to sort the icons
|
||||
+
|
||||
+ *property = data = new unsigned long[sz];
|
||||
+ *len = sz;
|
||||
+
|
||||
+ for (int i = 0;i < count;i++) {
|
||||
+ const Fl_RGB_Image *image;
|
||||
+
|
||||
+ image = icons[i];
|
||||
+
|
||||
+ data[0] = image->w();
|
||||
+ data[1] = image->h();
|
||||
+ data += 2;
|
||||
+
|
||||
+ const uchar *in = (const uchar*)*image->data();
|
||||
+ for (int y = 0;y < image->h();y++) {
|
||||
+ for (int x = 0;x < image->w();x++) {
|
||||
+ switch (image->d()) {
|
||||
+ case 1:
|
||||
+ *data = ( 0xff<<24) | (in[0]<<16) | (in[0]<<8) | in[0];
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ *data = (in[1]<<24) | (in[0]<<16) | (in[0]<<8) | in[0];
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ *data = ( 0xff<<24) | (in[0]<<16) | (in[1]<<8) | in[2];
|
||||
+ break;
|
||||
+ case 4:
|
||||
+ *data = (in[3]<<24) | (in[0]<<16) | (in[1]<<8) | in[2];
|
||||
+ break;
|
||||
+ }
|
||||
+ in += image->d();
|
||||
+ data++;
|
||||
+ }
|
||||
+ in += image->ld();
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void Fl_X::set_default_icons(const Fl_RGB_Image *icons[], int count) {
|
||||
+ if (default_net_wm_icons) {
|
||||
+ delete [] default_net_wm_icons;
|
||||
+ default_net_wm_icons = 0L;
|
||||
+ default_net_wm_icons_size = 0;
|
||||
+ }
|
||||
+
|
||||
+ if (count > 0)
|
||||
+ icons_to_property(icons, count,
|
||||
+ &default_net_wm_icons, &default_net_wm_icons_size);
|
||||
+}
|
||||
+
|
||||
+void Fl_X::set_icons() {
|
||||
+ unsigned long *net_wm_icons;
|
||||
+ size_t net_wm_icons_size;
|
||||
+
|
||||
+ if (w->icon_->count) {
|
||||
+ icons_to_property((const Fl_RGB_Image **)w->icon_->icons, w->icon_->count,
|
||||
+ &net_wm_icons, &net_wm_icons_size);
|
||||
+ } else {
|
||||
+ net_wm_icons = default_net_wm_icons;
|
||||
+ net_wm_icons_size = default_net_wm_icons_size;
|
||||
+ }
|
||||
+
|
||||
+ XChangeProperty (fl_display, xid, fl_NET_WM_ICON, XA_CARDINAL, 32,
|
||||
+ PropModeReplace, (unsigned char*) net_wm_icons, net_wm_icons_size);
|
||||
+
|
||||
+ if (w->icon_->count) {
|
||||
+ delete [] net_wm_icons;
|
||||
+ net_wm_icons = 0L;
|
||||
+ net_wm_icons_size = 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+////////////////////////////////////////////////////////////////
|
||||
+
|
||||
int Fl_X::set_cursor(Fl_Cursor c) {
|
||||
unsigned int shape;
|
||||
Cursor xc;
|
||||
@@ -0,0 +1,135 @@
|
||||
diff -ur fltk-1.3.0r9110.org/src/Fl_win32.cxx fltk-1.3.0r9110/src/Fl_win32.cxx
|
||||
--- fltk-1.3.0r9110.org/src/Fl_win32.cxx 2012-06-17 19:42:02.169422400 +0200
|
||||
+++ fltk-1.3.0r9110/src/Fl_win32.cxx 2012-06-17 19:43:38.286031455 +0200
|
||||
@@ -543,6 +543,37 @@
|
||||
const char* GetValue() const { return(out); }
|
||||
};
|
||||
|
||||
+void fl_update_clipboard(void) {
|
||||
+ Fl_Window *w1 = Fl::first_window();
|
||||
+ if (!w1)
|
||||
+ return;
|
||||
+
|
||||
+ HWND hwnd = fl_xid(w1);
|
||||
+
|
||||
+ if (!OpenClipboard(hwnd))
|
||||
+ return;
|
||||
+
|
||||
+ EmptyClipboard();
|
||||
+
|
||||
+ int utf16_len = fl_utf8toUtf16(fl_selection_buffer[1],
|
||||
+ fl_selection_length[1], 0, 0);
|
||||
+
|
||||
+ HGLOBAL hMem = GlobalAlloc(GHND, utf16_len * 2 + 2); // moveable and zero'ed mem alloc.
|
||||
+ LPVOID memLock = GlobalLock(hMem);
|
||||
+
|
||||
+ fl_utf8toUtf16(fl_selection_buffer[1], fl_selection_length[1],
|
||||
+ (unsigned short*) memLock, utf16_len + 1);
|
||||
+
|
||||
+ GlobalUnlock(hMem);
|
||||
+ SetClipboardData(CF_UNICODETEXT, hMem);
|
||||
+
|
||||
+ CloseClipboard();
|
||||
+
|
||||
+ // In case Windows managed to lob of a WM_DESTROYCLIPBOARD during
|
||||
+ // the above.
|
||||
+ fl_i_own_selection[1] = 1;
|
||||
+}
|
||||
+
|
||||
// call this when you create a selection:
|
||||
void Fl::copy(const char *stuff, int len, int clipboard) {
|
||||
if (!stuff || len<0) return;
|
||||
@@ -560,25 +591,9 @@
|
||||
memcpy(fl_selection_buffer[clipboard], stuff, len);
|
||||
fl_selection_buffer[clipboard][len] = 0; // needed for direct paste
|
||||
fl_selection_length[clipboard] = len;
|
||||
- if (clipboard) {
|
||||
- // set up for "delayed rendering":
|
||||
- if (OpenClipboard(NULL)) {
|
||||
- // if the system clipboard works, use it
|
||||
- int utf16_len = fl_utf8toUtf16(fl_selection_buffer[clipboard], fl_selection_length[clipboard], 0, 0);
|
||||
- EmptyClipboard();
|
||||
- HGLOBAL hMem = GlobalAlloc(GHND, utf16_len * 2 + 2); // moveable and zero'ed mem alloc.
|
||||
- LPVOID memLock = GlobalLock(hMem);
|
||||
- fl_utf8toUtf16(fl_selection_buffer[clipboard], fl_selection_length[clipboard], (unsigned short*) memLock, utf16_len + 1);
|
||||
- GlobalUnlock(hMem);
|
||||
- SetClipboardData(CF_UNICODETEXT, hMem);
|
||||
- CloseClipboard();
|
||||
- GlobalFree(hMem);
|
||||
- fl_i_own_selection[clipboard] = 0;
|
||||
- } else {
|
||||
- // only if it fails, instruct paste() to use the internal buffers
|
||||
- fl_i_own_selection[clipboard] = 1;
|
||||
- }
|
||||
- }
|
||||
+ fl_i_own_selection[clipboard] = 1;
|
||||
+ if (clipboard)
|
||||
+ fl_update_clipboard();
|
||||
}
|
||||
|
||||
// Call this when a "paste" operation happens:
|
||||
@@ -1307,33 +1322,6 @@
|
||||
fl_i_own_selection[1] = 0;
|
||||
return 1;
|
||||
|
||||
- case WM_RENDERALLFORMATS:
|
||||
- fl_i_own_selection[1] = 0;
|
||||
- // Windoze seems unhappy unless I do these two steps. Documentation
|
||||
- // seems to vary on whether opening the clipboard is necessary or
|
||||
- // is in fact wrong:
|
||||
- CloseClipboard();
|
||||
- OpenClipboard(NULL);
|
||||
- // fall through...
|
||||
- case WM_RENDERFORMAT: {
|
||||
- HANDLE h;
|
||||
-
|
||||
-// int l = fl_utf_nb_char((unsigned char*)fl_selection_buffer[1], fl_selection_length[1]);
|
||||
- int l = fl_utf8toUtf16(fl_selection_buffer[1], fl_selection_length[1], NULL, 0); // Pass NULL buffer to query length required
|
||||
- h = GlobalAlloc(GHND, (l+1) * sizeof(unsigned short));
|
||||
- if (h) {
|
||||
- unsigned short *g = (unsigned short*) GlobalLock(h);
|
||||
-// fl_utf2unicode((unsigned char *)fl_selection_buffer[1], fl_selection_length[1], (xchar*)g);
|
||||
- l = fl_utf8toUtf16(fl_selection_buffer[1], fl_selection_length[1], g, (l+1));
|
||||
- g[l] = 0;
|
||||
- GlobalUnlock(h);
|
||||
- SetClipboardData(CF_UNICODETEXT, h);
|
||||
- }
|
||||
-
|
||||
- // Windoze also seems unhappy if I don't do this. Documentation very
|
||||
- // unclear on what is correct:
|
||||
- if (fl_msg.message == WM_RENDERALLFORMATS) CloseClipboard();
|
||||
- return 1;}
|
||||
case WM_DISPLAYCHANGE: // occurs when screen configuration (number, position) changes
|
||||
Fl::call_screen_init();
|
||||
Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
|
||||
diff -ur fltk-1.3.0r9110.org/src/Fl.cxx fltk-1.3.0r9110/src/Fl.cxx
|
||||
--- fltk-1.3.0r9110.org/src/Fl.cxx 2012-06-17 19:42:02.173422595 +0200
|
||||
+++ fltk-1.3.0r9110/src/Fl.cxx 2012-06-17 19:42:02.317429497 +0200
|
||||
@@ -1420,7 +1420,9 @@
|
||||
////////////////////////////////////////////////////////////////
|
||||
// hide() destroys the X window, it does not do unmap!
|
||||
|
||||
-#if !defined(WIN32) && USE_XFT
|
||||
+#if defined(WIN32)
|
||||
+extern void fl_update_clipboard(void);
|
||||
+#elif USE_XFT
|
||||
extern void fl_destroy_xft_draw(Window);
|
||||
#endif
|
||||
|
||||
@@ -1467,14 +1469,8 @@
|
||||
#if defined(WIN32)
|
||||
// this little trick keeps the current clipboard alive, even if we are about
|
||||
// to destroy the window that owns the selection.
|
||||
- if (GetClipboardOwner()==ip->xid) {
|
||||
- Fl_Window *w1 = Fl::first_window();
|
||||
- if (w1 && OpenClipboard(fl_xid(w1))) {
|
||||
- EmptyClipboard();
|
||||
- SetClipboardData(CF_TEXT, NULL);
|
||||
- CloseClipboard();
|
||||
- }
|
||||
- }
|
||||
+ if (GetClipboardOwner()==ip->xid)
|
||||
+ fl_update_clipboard();
|
||||
// Send a message to myself so that I'll get out of the event loop...
|
||||
PostMessage(ip->xid, WM_APP, 0, 0);
|
||||
if (ip->private_dc) fl_release_dc(ip->xid, ip->private_dc);
|
||||
468
contrib/packages/rpm/el6/SOURCES/fltk-1_v3.3.x-multihead.patch
Normal file
468
contrib/packages/rpm/el6/SOURCES/fltk-1_v3.3.x-multihead.patch
Normal file
@@ -0,0 +1,468 @@
|
||||
diff -urp fltk-1.3.2.org/FL/Fl_Window.H fltk-1.3.2/FL/Fl_Window.H
|
||||
--- fltk-1.3.2.org/FL/Fl_Window.H 2013-01-16 10:52:33.017228122 +0100
|
||||
+++ fltk-1.3.2/FL/Fl_Window.H 2013-01-16 10:52:47.876478968 +0100
|
||||
@@ -54,7 +54,7 @@ class Fl_RGB_Image;
|
||||
class FL_EXPORT Fl_Window : public Fl_Group {
|
||||
|
||||
static char *default_xclass_;
|
||||
- // Note: we must use separate statements for each of the following 4 variables,
|
||||
+ // Note: we must use separate statements for each of the following 8 variables,
|
||||
// with the static attribute, otherwise MS VC++ 2008/2010 complains :-(
|
||||
// AlbrechtS 04/2012
|
||||
#if FLTK_ABI_VERSION < 10301
|
||||
@@ -73,6 +73,22 @@ class FL_EXPORT Fl_Window : public Fl_Gr
|
||||
static // when these members are static, ABI compatibility with 1.3.0 is respected
|
||||
#endif
|
||||
int no_fullscreen_h;
|
||||
+#if FLTK_ABI_VERSION < 10302
|
||||
+ static // when these members are static, ABI compatibility with 1.3.0 is respected
|
||||
+#endif
|
||||
+ int fullscreen_screen_top;
|
||||
+#if FLTK_ABI_VERSION < 10302
|
||||
+ static // when these members are static, ABI compatibility with 1.3.0 is respected
|
||||
+#endif
|
||||
+ int fullscreen_screen_bottom;
|
||||
+#if FLTK_ABI_VERSION < 10302
|
||||
+ static // when these members are static, ABI compatibility with 1.3.0 is respected
|
||||
+#endif
|
||||
+ int fullscreen_screen_left;
|
||||
+#if FLTK_ABI_VERSION < 10302
|
||||
+ static // when these members are static, ABI compatibility with 1.3.0 is respected
|
||||
+#endif
|
||||
+ int fullscreen_screen_right;
|
||||
|
||||
friend class Fl_X;
|
||||
Fl_X *i; // points at the system-specific stuff
|
||||
@@ -430,13 +446,15 @@ public:
|
||||
*/
|
||||
void show(int argc, char **argv);
|
||||
/**
|
||||
- Makes the window completely fill the screen, without any window
|
||||
- manager border visible. You must use fullscreen_off() to undo
|
||||
- this.
|
||||
+ Makes the window completely fill one or more screens, without any
|
||||
+ window manager border visible. You must use fullscreen_off() to
|
||||
+ undo this.
|
||||
|
||||
\note On some platforms, this can result in the keyboard being
|
||||
grabbed. The window may also be recreated, meaning hide() and
|
||||
show() will be called.
|
||||
+
|
||||
+ \see void Fl_Window::fullscreen_screens()
|
||||
*/
|
||||
void fullscreen();
|
||||
/**
|
||||
@@ -453,6 +471,17 @@ public:
|
||||
*/
|
||||
unsigned int fullscreen_active() const { return flags() & FULLSCREEN; }
|
||||
/**
|
||||
+ Sets which screens should be used when this window is in fullscreen
|
||||
+ mode. The window will be resized to the top of the screen with index
|
||||
+ \p top, the bottom of the screen with index \p bottom, etc.
|
||||
+
|
||||
+ If this method is never called, or if any argument is < 0, then the
|
||||
+ window will be resized to fill the screen it is currently on.
|
||||
+
|
||||
+ \see void Fl_Window::fullscreen()
|
||||
+ */
|
||||
+ void fullscreen_screens(int top, int bottom, int left, int right);
|
||||
+ /**
|
||||
Iconifies the window. If you call this when shown() is false
|
||||
it will show() it as an icon. If the window is already
|
||||
iconified this does nothing.
|
||||
diff -urp fltk-1.3.2.org/FL/win32.H fltk-1.3.2/FL/win32.H
|
||||
--- fltk-1.3.2.org/FL/win32.H 2013-01-16 10:52:33.017228122 +0100
|
||||
+++ fltk-1.3.2/FL/win32.H 2013-01-16 10:52:47.876478968 +0100
|
||||
@@ -80,6 +80,7 @@ public:
|
||||
static Fl_X* i(const Fl_Window* w) {return w->i;}
|
||||
static int fake_X_wm(const Fl_Window* w,int &X, int &Y,
|
||||
int &bt,int &bx,int &by);
|
||||
+ void make_fullscreen(int X, int Y, int W, int H);
|
||||
void setwindow(Fl_Window* wi) {w=wi; wi->i=this;}
|
||||
void flush() {w->flush();}
|
||||
void set_minmax(LPMINMAXINFO minmax);
|
||||
diff -urp fltk-1.3.2.org/src/Fl_cocoa.mm fltk-1.3.2/src/Fl_cocoa.mm
|
||||
--- fltk-1.3.2.org/src/Fl_cocoa.mm 2013-01-16 10:52:33.014229574 +0100
|
||||
+++ fltk-1.3.2/src/Fl_cocoa.mm 2013-01-16 10:52:47.877480606 +0100
|
||||
@@ -2438,9 +2438,32 @@ void Fl_X::make(Fl_Window* w)
|
||||
|
||||
NSRect crect;
|
||||
if (w->fullscreen_active()) {
|
||||
- int sx, sy, sw, sh;
|
||||
- Fl::screen_xywh(sx, sy, sw, sh, w->x(), w->y(), w->w(), w->h());
|
||||
- w->resize(sx, sy, sw, sh);
|
||||
+ int top, bottom, left, right;
|
||||
+ int sx, sy, sw, sh, X, Y, W, H;
|
||||
+
|
||||
+ top = w->fullscreen_screen_top;
|
||||
+ bottom = w->fullscreen_screen_bottom;
|
||||
+ left = w->fullscreen_screen_left;
|
||||
+ right = w->fullscreen_screen_right;
|
||||
+
|
||||
+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) {
|
||||
+ top = Fl::screen_num(w->x(), w->y(), w->w(), w->h());
|
||||
+ bottom = top;
|
||||
+ left = top;
|
||||
+ right = top;
|
||||
+ }
|
||||
+
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, top);
|
||||
+ Y = sy;
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, bottom);
|
||||
+ H = sy + sh - Y;
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, left);
|
||||
+ X = sx;
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, right);
|
||||
+ W = sx + sw - X;
|
||||
+
|
||||
+ w->resize(X, Y, W, H);
|
||||
+
|
||||
winstyle = NSBorderlessWindowMask;
|
||||
winlevel = NSStatusWindowLevel;
|
||||
}
|
||||
diff -urp fltk-1.3.2.org/src/Fl_win32.cxx fltk-1.3.2/src/Fl_win32.cxx
|
||||
--- fltk-1.3.2.org/src/Fl_win32.cxx 2013-01-16 10:52:33.019230734 +0100
|
||||
+++ fltk-1.3.2/src/Fl_win32.cxx 2013-01-16 10:52:47.878480504 +0100
|
||||
@@ -1493,7 +1493,6 @@ int Fl_X::fake_X_wm(const Fl_Window* w,i
|
||||
Y+=yoff;
|
||||
|
||||
if (w->fullscreen_active()) {
|
||||
- X = Y = 0;
|
||||
bx = by = bt = 0;
|
||||
}
|
||||
|
||||
@@ -1547,19 +1546,42 @@ void Fl_Window::resize(int X,int Y,int W
|
||||
}
|
||||
}
|
||||
|
||||
-static void make_fullscreen(Fl_Window *w, Window xid, int X, int Y, int W, int H) {
|
||||
+void Fl_X::make_fullscreen(int X, int Y, int W, int H) {
|
||||
+ int top, bottom, left, right;
|
||||
int sx, sy, sw, sh;
|
||||
- Fl::screen_xywh(sx, sy, sw, sh, X, Y, W, H);
|
||||
+
|
||||
+ top = w->fullscreen_screen_top;
|
||||
+ bottom = w->fullscreen_screen_bottom;
|
||||
+ left = w->fullscreen_screen_left;
|
||||
+ right = w->fullscreen_screen_right;
|
||||
+
|
||||
+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) {
|
||||
+ top = Fl::screen_num(X, Y, W, H);
|
||||
+ bottom = top;
|
||||
+ left = top;
|
||||
+ right = top;
|
||||
+ }
|
||||
+
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, top);
|
||||
+ Y = sy;
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, bottom);
|
||||
+ H = sy + sh - Y;
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, left);
|
||||
+ X = sx;
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, right);
|
||||
+ W = sx + sw - X;
|
||||
+
|
||||
DWORD flags = GetWindowLong(xid, GWL_STYLE);
|
||||
flags = flags & ~(WS_THICKFRAME|WS_CAPTION);
|
||||
SetWindowLong(xid, GWL_STYLE, flags);
|
||||
+
|
||||
// SWP_NOSENDCHANGING is so that we can override size limits
|
||||
- SetWindowPos(xid, HWND_TOP, sx, sy, sw, sh, SWP_NOSENDCHANGING | SWP_FRAMECHANGED);
|
||||
+ SetWindowPos(xid, HWND_TOP, X, Y, W, H, SWP_NOSENDCHANGING | SWP_FRAMECHANGED);
|
||||
}
|
||||
|
||||
void Fl_Window::fullscreen_x() {
|
||||
_set_fullscreen();
|
||||
- make_fullscreen(this, fl_xid(this), x(), y(), w(), h());
|
||||
+ i->make_fullscreen(x(), y(), w(), h());
|
||||
Fl::handle(FL_FULLSCREEN, this);
|
||||
}
|
||||
|
||||
@@ -1814,8 +1836,8 @@ Fl_X* Fl_X::make(Fl_Window* w) {
|
||||
monitor the window was placed on. */
|
||||
RECT rect;
|
||||
GetWindowRect(x->xid, &rect);
|
||||
- make_fullscreen(w, x->xid, rect.left, rect.top,
|
||||
- rect.right - rect.left, rect.bottom - rect.top);
|
||||
+ x->make_fullscreen(rect.left, rect.top,
|
||||
+ rect.right - rect.left, rect.bottom - rect.top);
|
||||
}
|
||||
|
||||
x->next = Fl_X::first;
|
||||
diff -urp fltk-1.3.2.org/src/Fl_Window_fullscreen.cxx fltk-1.3.2/src/Fl_Window_fullscreen.cxx
|
||||
--- fltk-1.3.2.org/src/Fl_Window_fullscreen.cxx 2012-11-06 21:46:14.000000000 +0100
|
||||
+++ fltk-1.3.2/src/Fl_Window_fullscreen.cxx 2013-01-16 10:52:47.879480608 +0100
|
||||
@@ -36,6 +36,10 @@ int Fl_Window::no_fullscreen_x = 0;
|
||||
int Fl_Window::no_fullscreen_y = 0;
|
||||
int Fl_Window::no_fullscreen_w = 0;
|
||||
int Fl_Window::no_fullscreen_h = 0;
|
||||
+int Fl_Window::fullscreen_screen_top = -1;
|
||||
+int Fl_Window::fullscreen_screen_bottom = -1;
|
||||
+int Fl_Window::fullscreen_screen_left = -1;
|
||||
+int Fl_Window::fullscreen_screen_right = -1;
|
||||
#endif
|
||||
|
||||
void Fl_Window::border(int b) {
|
||||
@@ -95,6 +99,23 @@ void Fl_Window::fullscreen_off() {
|
||||
fullscreen_off(no_fullscreen_x, no_fullscreen_y, no_fullscreen_w, no_fullscreen_h);
|
||||
}
|
||||
|
||||
+void Fl_Window::fullscreen_screens(int top, int bottom, int left, int right) {
|
||||
+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) {
|
||||
+ fullscreen_screen_top = -1;
|
||||
+ fullscreen_screen_bottom = -1;
|
||||
+ fullscreen_screen_left = -1;
|
||||
+ fullscreen_screen_right = -1;
|
||||
+ } else {
|
||||
+ fullscreen_screen_top = top;
|
||||
+ fullscreen_screen_bottom = bottom;
|
||||
+ fullscreen_screen_left = left;
|
||||
+ fullscreen_screen_right = right;
|
||||
+ }
|
||||
+
|
||||
+ if (shown() && (flags() & Fl_Widget::FULLSCREEN))
|
||||
+ fullscreen_x();
|
||||
+}
|
||||
+
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Window_fullscreen.cxx 9706 2012-11-06 20:46:14Z matt $".
|
||||
diff -urp fltk-1.3.2.org/src/Fl_x.cxx fltk-1.3.2/src/Fl_x.cxx
|
||||
--- fltk-1.3.2.org/src/Fl_x.cxx 2013-01-16 10:52:33.020228202 +0100
|
||||
+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-16 10:52:47.880480556 +0100
|
||||
@@ -344,6 +344,7 @@ Atom fl_NET_WM_ICON_NAME; // utf8 aware
|
||||
Atom fl_NET_SUPPORTING_WM_CHECK;
|
||||
Atom fl_NET_WM_STATE;
|
||||
Atom fl_NET_WM_STATE_FULLSCREEN;
|
||||
+Atom fl_NET_WM_FULLSCREEN_MONITORS;
|
||||
Atom fl_NET_WORKAREA;
|
||||
Atom fl_NET_WM_ICON;
|
||||
|
||||
@@ -709,6 +710,7 @@ void fl_open_display(Display* d) {
|
||||
fl_NET_SUPPORTING_WM_CHECK = XInternAtom(d, "_NET_SUPPORTING_WM_CHECK", 0);
|
||||
fl_NET_WM_STATE = XInternAtom(d, "_NET_WM_STATE", 0);
|
||||
fl_NET_WM_STATE_FULLSCREEN = XInternAtom(d, "_NET_WM_STATE_FULLSCREEN", 0);
|
||||
+ fl_NET_WM_FULLSCREEN_MONITORS = XInternAtom(d, "_NET_WM_FULLSCREEN_MONITORS", 0);
|
||||
fl_NET_WORKAREA = XInternAtom(d, "_NET_WORKAREA", 0);
|
||||
fl_NET_WM_ICON = XInternAtom(d, "_NET_WM_ICON", 0);
|
||||
|
||||
@@ -1872,22 +1874,30 @@ void Fl_Window::resize(int X,int Y,int W
|
||||
#define _NET_WM_STATE_ADD 1 /* add/set property */
|
||||
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
|
||||
|
||||
-static void send_wm_state_event(Window wnd, int add, Atom prop) {
|
||||
+static void send_wm_event(Window wnd, Atom message,
|
||||
+ unsigned long d0, unsigned long d1=0,
|
||||
+ unsigned long d2=0, unsigned long d3=0,
|
||||
+ unsigned long d4=0) {
|
||||
XEvent e;
|
||||
e.xany.type = ClientMessage;
|
||||
e.xany.window = wnd;
|
||||
- e.xclient.message_type = fl_NET_WM_STATE;
|
||||
+ e.xclient.message_type = message;
|
||||
e.xclient.format = 32;
|
||||
- e.xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
|
||||
- e.xclient.data.l[1] = prop;
|
||||
- e.xclient.data.l[2] = 0;
|
||||
- e.xclient.data.l[3] = 0;
|
||||
- e.xclient.data.l[4] = 0;
|
||||
+ e.xclient.data.l[0] = d0;
|
||||
+ e.xclient.data.l[1] = d1;
|
||||
+ e.xclient.data.l[2] = d2;
|
||||
+ e.xclient.data.l[3] = d3;
|
||||
+ e.xclient.data.l[4] = d4;
|
||||
XSendEvent(fl_display, RootWindow(fl_display, fl_screen),
|
||||
0, SubstructureNotifyMask | SubstructureRedirectMask,
|
||||
&e);
|
||||
}
|
||||
|
||||
+static void send_wm_state_event(Window wnd, int add, Atom prop) {
|
||||
+ send_wm_event(wnd, fl_NET_WM_STATE,
|
||||
+ add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE, prop);
|
||||
+}
|
||||
+
|
||||
int Fl_X::ewmh_supported() {
|
||||
static int result = -1;
|
||||
|
||||
@@ -1911,6 +1921,22 @@ int Fl_X::ewmh_supported() {
|
||||
/* Change an existing window to fullscreen */
|
||||
void Fl_Window::fullscreen_x() {
|
||||
if (Fl_X::ewmh_supported()) {
|
||||
+ int top, bottom, left, right;
|
||||
+
|
||||
+ top = fullscreen_screen_top;
|
||||
+ bottom = fullscreen_screen_bottom;
|
||||
+ left = fullscreen_screen_left;
|
||||
+ right = fullscreen_screen_right;
|
||||
+
|
||||
+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) {
|
||||
+ top = Fl::screen_num(x(), y(), w(), h());
|
||||
+ bottom = top;
|
||||
+ left = top;
|
||||
+ right = top;
|
||||
+ }
|
||||
+
|
||||
+ send_wm_event(fl_xid(this), fl_NET_WM_FULLSCREEN_MONITORS,
|
||||
+ top, bottom, left, right);
|
||||
send_wm_state_event(fl_xid(this), 1, fl_NET_WM_STATE_FULLSCREEN);
|
||||
} else {
|
||||
_set_fullscreen();
|
||||
@@ -1997,7 +2023,7 @@ void Fl_X::make_xid(Fl_Window* win, XVis
|
||||
// force the window to be on-screen. Usually the X window manager
|
||||
// does this, but a few don't, so we do it here for consistency:
|
||||
int scr_x, scr_y, scr_w, scr_h;
|
||||
- Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h, X, Y);
|
||||
+ Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h, X, Y, W, H);
|
||||
|
||||
if (win->border()) {
|
||||
// ensure border is on screen:
|
||||
@@ -2026,6 +2052,23 @@ void Fl_X::make_xid(Fl_Window* win, XVis
|
||||
return;
|
||||
}
|
||||
|
||||
+ // Compute which screen(s) we should be on if we want to go fullscreen
|
||||
+ int fullscreen_top, fullscreen_bottom, fullscreen_left, fullscreen_right;
|
||||
+
|
||||
+ fullscreen_top = win->fullscreen_screen_top;
|
||||
+ fullscreen_bottom = win->fullscreen_screen_bottom;
|
||||
+ fullscreen_left = win->fullscreen_screen_left;
|
||||
+ fullscreen_right = win->fullscreen_screen_right;
|
||||
+
|
||||
+ if ((fullscreen_top < 0) || (fullscreen_bottom < 0) ||
|
||||
+ (fullscreen_left < 0) || (fullscreen_right < 0)) {
|
||||
+ fullscreen_top = Fl::screen_num(X, Y, W, H);
|
||||
+ fullscreen_bottom = fullscreen_top;
|
||||
+ fullscreen_left = fullscreen_top;
|
||||
+ fullscreen_right = fullscreen_top;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
ulong root = win->parent() ?
|
||||
fl_xid(win->window()) : RootWindow(fl_display, fl_screen);
|
||||
|
||||
@@ -2049,9 +2092,17 @@ void Fl_X::make_xid(Fl_Window* win, XVis
|
||||
// border, and cannot grab without an existing window. Besides,
|
||||
// there is no clear_override().
|
||||
if (win->flags() & Fl_Widget::FULLSCREEN && !Fl_X::ewmh_supported()) {
|
||||
+ int sx, sy, sw, sh;
|
||||
attr.override_redirect = 1;
|
||||
mask |= CWOverrideRedirect;
|
||||
- Fl::screen_xywh(X, Y, W, H, X, Y, W, H);
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_left);
|
||||
+ X = sx;
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_right);
|
||||
+ W = sx + sw - X;
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_top);
|
||||
+ Y = sy;
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_bottom);
|
||||
+ H = sy + sh - Y;
|
||||
}
|
||||
|
||||
if (fl_background_pixel >= 0) {
|
||||
@@ -2122,6 +2173,13 @@ void Fl_X::make_xid(Fl_Window* win, XVis
|
||||
|
||||
// If asked for, create fullscreen
|
||||
if (win->flags() & Fl_Widget::FULLSCREEN && Fl_X::ewmh_supported()) {
|
||||
+ unsigned long data[4];
|
||||
+ data[0] = fullscreen_top;
|
||||
+ data[1] = fullscreen_bottom;
|
||||
+ data[2] = fullscreen_left;
|
||||
+ data[3] = fullscreen_right;
|
||||
+ XChangeProperty (fl_display, xp->xid, fl_NET_WM_FULLSCREEN_MONITORS, XA_ATOM, 32,
|
||||
+ PropModeReplace, (unsigned char*) data, 4);
|
||||
XChangeProperty (fl_display, xp->xid, fl_NET_WM_STATE, XA_ATOM, 32,
|
||||
PropModeAppend, (unsigned char*) &fl_NET_WM_STATE_FULLSCREEN, 1);
|
||||
}
|
||||
diff -urp fltk-1.3.2.org/test/fullscreen.cxx fltk-1.3.2/test/fullscreen.cxx
|
||||
--- fltk-1.3.2.org/test/fullscreen.cxx 2012-06-14 17:09:46.000000000 +0200
|
||||
+++ fltk-1.3.2/test/fullscreen.cxx 2013-01-16 10:52:47.881104801 +0100
|
||||
@@ -127,7 +127,7 @@ class fullscreen_window : public Fl_Sing
|
||||
fullscreen_window(int W, int H, const char *t=0);
|
||||
int handle (int e);
|
||||
Fl_Toggle_Light_Button *b3;
|
||||
-
|
||||
+ Fl_Toggle_Light_Button *b4;
|
||||
};
|
||||
|
||||
fullscreen_window::fullscreen_window(int W, int H, const char *t) : Fl_Single_Window(W, H, t) {
|
||||
@@ -170,23 +170,54 @@ void border_cb(Fl_Widget *o, void *p) {
|
||||
#endif
|
||||
}
|
||||
|
||||
-int px,py,pw,ph;
|
||||
Fl_Button *border_button;
|
||||
void fullscreen_cb(Fl_Widget *o, void *p) {
|
||||
Fl_Window *w = (Fl_Window *)p;
|
||||
int d = ((Fl_Button *)o)->value();
|
||||
if (d) {
|
||||
- px = w->x();
|
||||
- py = w->y();
|
||||
- pw = w->w();
|
||||
- ph = w->h();
|
||||
+ if (((fullscreen_window*)w)->b4->value()) {
|
||||
+ int top, bottom, left, right;
|
||||
+ int top_y, bottom_y, left_x, right_x;
|
||||
+
|
||||
+ int sx, sy, sw, sh;
|
||||
+
|
||||
+ top = bottom = left = right = 0;
|
||||
+
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, 0);
|
||||
+ top_y = sy;
|
||||
+ bottom_y = sy + sh;
|
||||
+ left_x = sx;
|
||||
+ right_x = sx + sw;
|
||||
+
|
||||
+ for (int i = 1;i < Fl::screen_count();i++) {
|
||||
+ Fl::screen_xywh(sx, sy, sw, sh, i);
|
||||
+ if (sy < top_y) {
|
||||
+ top = i;
|
||||
+ top_y = sy;
|
||||
+ }
|
||||
+ if ((sy + sh) > bottom_y) {
|
||||
+ bottom = i;
|
||||
+ bottom_y = sy + sh;
|
||||
+ }
|
||||
+ if (sx < left_x) {
|
||||
+ left = i;
|
||||
+ left_x = sx;
|
||||
+ }
|
||||
+ if ((sx + sw) > right_x) {
|
||||
+ right = i;
|
||||
+ right_x = sx + sw;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ w->fullscreen_screens(top, bottom, left, right);
|
||||
+ } else {
|
||||
+ w->fullscreen_screens(-1, -1, -1, -1);
|
||||
+ }
|
||||
w->fullscreen();
|
||||
- w->override();
|
||||
#ifndef WIN32 // update our border state in case border was turned off
|
||||
border_button->value(w->border());
|
||||
#endif
|
||||
} else {
|
||||
- //w->fullscreen_off(px,py,pw,ph);
|
||||
w->fullscreen_off();
|
||||
}
|
||||
}
|
||||
@@ -219,7 +250,7 @@ void exit_cb(Fl_Widget *, void *) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
-#define NUMB 7
|
||||
+#define NUMB 8
|
||||
|
||||
int twowindow = 0;
|
||||
int initfull = 0;
|
||||
@@ -284,6 +315,9 @@ int main(int argc, char **argv) {
|
||||
window.b3->callback(fullscreen_cb,w);
|
||||
y+=30;
|
||||
|
||||
+ window.b4 = new Fl_Toggle_Light_Button(50,y,window.w()-60,30,"All Screens");
|
||||
+ y+=30;
|
||||
+
|
||||
Fl_Button eb(50,y,window.w()-60,30,"Exit");
|
||||
eb.callback(exit_cb);
|
||||
y+=30;
|
||||
@@ -0,0 +1,256 @@
|
||||
diff -ur fltk-1.3.0r9293.org/src/Fl_win32.cxx fltk-1.3.0r9293/src/Fl_win32.cxx
|
||||
--- fltk-1.3.0r9293.org/src/Fl_win32.cxx 2012-06-18 09:07:56.522314557 +0200
|
||||
+++ fltk-1.3.0r9293/src/Fl_win32.cxx 2012-06-18 09:08:07.392836285 +0200
|
||||
@@ -87,6 +87,8 @@
|
||||
static Fl_Display_Device fl_gdi_display(&fl_gdi_driver);
|
||||
Fl_Display_Device *Fl_Display_Device::_display = &fl_gdi_display; // the platform display
|
||||
|
||||
+bool use_simple_keyboard = false;
|
||||
+
|
||||
// dynamic wsock dll handling api:
|
||||
#if defined(__CYGWIN__) && !defined(SOCKET)
|
||||
# define SOCKET int
|
||||
@@ -120,6 +122,8 @@
|
||||
* size and link dependencies.
|
||||
*/
|
||||
static HMODULE s_imm_module = 0;
|
||||
+typedef BOOL (WINAPI* flTypeImmAssociateContextEx)(HWND, HIMC, DWORD);
|
||||
+static flTypeImmAssociateContextEx flImmAssociateContextEx = 0;
|
||||
typedef HIMC (WINAPI* flTypeImmGetContext)(HWND);
|
||||
static flTypeImmGetContext flImmGetContext = 0;
|
||||
typedef BOOL (WINAPI* flTypeImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM);
|
||||
@@ -135,6 +139,7 @@
|
||||
if (!s_imm_module)
|
||||
Fl::fatal("FLTK Lib Error: IMM32.DLL file not found!\n\n"
|
||||
"Please check your input method manager library accessibility.");
|
||||
+ flImmAssociateContextEx = (flTypeImmAssociateContextEx)GetProcAddress(s_imm_module, "ImmAssociateContextEx");
|
||||
flImmGetContext = (flTypeImmGetContext)GetProcAddress(s_imm_module, "ImmGetContext");
|
||||
flImmSetCompositionWindow = (flTypeImmSetCompositionWindow)GetProcAddress(s_imm_module, "ImmSetCompositionWindow");
|
||||
flImmReleaseContext = (flTypeImmReleaseContext)GetProcAddress(s_imm_module, "ImmReleaseContext");
|
||||
@@ -413,7 +418,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
- TranslateMessage(&fl_msg);
|
||||
+ // Don't bother with key to character translation as we do
|
||||
+ // it manually for simpley keyboard widgets. In fact, calling
|
||||
+ // TranslateMessage() just makes it more difficult as it sets
|
||||
+ // a bunch of internal state.
|
||||
+ if (!use_simple_keyboard)
|
||||
+ TranslateMessage(&fl_msg);
|
||||
DispatchMessageW(&fl_msg);
|
||||
have_message = PeekMessageW(&fl_msg, NULL, 0, 0, PM_REMOVE);
|
||||
}
|
||||
@@ -638,6 +648,49 @@
|
||||
}
|
||||
}
|
||||
|
||||
+void fl_update_focus(void)
|
||||
+{
|
||||
+ Fl_Widget *focus;
|
||||
+ Fl_Window *win;
|
||||
+
|
||||
+ get_imm_module();
|
||||
+
|
||||
+ focus = Fl::grab();
|
||||
+ if (!focus)
|
||||
+ focus = Fl::focus();
|
||||
+ if (!focus)
|
||||
+ return;
|
||||
+
|
||||
+ // Grabs are special in that events are sent to the first
|
||||
+ // available window
|
||||
+ if (focus == Fl::grab())
|
||||
+ win = Fl::first_window();
|
||||
+ else {
|
||||
+ win = focus->as_window();
|
||||
+ if (!win)
|
||||
+ win = focus->window();
|
||||
+ }
|
||||
+
|
||||
+ if (!win) {
|
||||
+ Fl::warning("Cannot find window for widget receiving focus");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // No Win32 window created yet
|
||||
+ if (!Fl_X::i(win) || !fl_xid(win))
|
||||
+ return;
|
||||
+
|
||||
+ if (focus->simple_keyboard()) {
|
||||
+ use_simple_keyboard = true;
|
||||
+ if (flImmGetContext(fl_xid(win)) != 0)
|
||||
+ flImmAssociateContextEx(fl_xid(win), 0, 0);
|
||||
+ } else {
|
||||
+ use_simple_keyboard = false;
|
||||
+ if (flImmGetContext(fl_xid(win)) == 0)
|
||||
+ flImmAssociateContextEx(fl_xid(win), 0, IACE_DEFAULT);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
HWND fl_capture;
|
||||
|
||||
static int mouse_event(Fl_Window *window, int what, int button,
|
||||
@@ -785,6 +838,27 @@
|
||||
return extended ? extendedlut[vk] : vklut[vk];
|
||||
}
|
||||
|
||||
+static xchar msdead2fltk(xchar in)
|
||||
+{
|
||||
+ switch (in) {
|
||||
+ case 0x0060: // GRAVE ACCENT
|
||||
+ return 0x0300; // COMBINING GRAVE ACCENT
|
||||
+ case 0x00b4: // ACUTE ACCENT
|
||||
+ return 0x0301; // COMBINING ACUTE ACCENT
|
||||
+ case 0x005e: // CIRCUMFLEX ACCENT
|
||||
+ return 0x0302; // COMBINING CIRCUMFLEX ACCENT
|
||||
+ case 0x007e: // TILDE
|
||||
+ return 0x0303; // COMBINING TILDE
|
||||
+ case 0x00a8: // DIAERESIS
|
||||
+ return 0x0308; // COMBINING DIAERESIS
|
||||
+ // FIXME: Windows dead key behaviour isn't documented and I don't have
|
||||
+ // any more keyboards to test with...
|
||||
+ }
|
||||
+
|
||||
+ // hope that Windows gave us something proper to begin with
|
||||
+ return in;
|
||||
+}
|
||||
+
|
||||
#if USE_COLORMAP
|
||||
extern HPALETTE fl_select_palette(void); // in fl_color_win32.cxx
|
||||
#endif
|
||||
@@ -846,6 +920,8 @@
|
||||
//fl_msg.pt = ???
|
||||
//fl_msg.lPrivate = ???
|
||||
|
||||
+ MSG fl_orig_msg = fl_msg;
|
||||
+
|
||||
Fl_Window *window = fl_find(hWnd);
|
||||
|
||||
if (window) switch (uMsg) {
|
||||
@@ -1025,23 +1101,82 @@
|
||||
if (GetKeyState(VK_SCROLL)) state |= FL_SCROLL_LOCK;
|
||||
Fl::e_state = state;
|
||||
static char buffer[1024];
|
||||
- if (uMsg == WM_CHAR || uMsg == WM_SYSCHAR) {
|
||||
|
||||
+ if (use_simple_keyboard) {
|
||||
+ BYTE keystate[256];
|
||||
+ WCHAR wbuf[8];
|
||||
+ int ret;
|
||||
+
|
||||
+ // I'm not sure if we ever get WM_CHAR (& friends) without an initial
|
||||
+ // WM_KEYDOWN (& friends), but if we do then we should not send such
|
||||
+ // side band events to simple keyboard widgets.
|
||||
+ if ((fl_orig_msg.message != WM_KEYDOWN) &&
|
||||
+ (fl_orig_msg.message != WM_SYSKEYDOWN) &&
|
||||
+ (fl_orig_msg.message != WM_KEYUP) &&
|
||||
+ (fl_orig_msg.message != WM_SYSKEYUP))
|
||||
+ break;
|
||||
+
|
||||
+ GetKeyboardState(keystate);
|
||||
+
|
||||
+ // Pressing Ctrl wreaks havoc with the symbol lookup, so turn that off.
|
||||
+ // But AltGr shows up as Ctrl+Alt in Windows, so keep Ctrl if Alt is
|
||||
+ // active.
|
||||
+ if (!(keystate[VK_MENU] & 0x80))
|
||||
+ keystate[VK_CONTROL] = keystate[VK_LCONTROL] = keystate[VK_RCONTROL] = 0;
|
||||
+
|
||||
+ // We cannot inspect or modify Windows' internal state of the keyboard
|
||||
+ // so we have to try to infer information from ToUnicode() and wedge
|
||||
+ // things into a known state.
|
||||
+ for (int i = 0;i < 2;i++) {
|
||||
+ ret = ToUnicode(fl_orig_msg.wParam, 0, keystate, wbuf,
|
||||
+ sizeof(wbuf)/sizeof(wbuf[0]), 0);
|
||||
+
|
||||
+ // No symbol for this key (or unexpected length)
|
||||
+ if ((ret == 0) || (ret < -1)) {
|
||||
+ buffer[0] = 0;
|
||||
+ Fl::e_length = 0;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ // A dead key. Convert this to a Unicode combining character so
|
||||
+ // that the application can tell the difference between dead and
|
||||
+ // normal keys.
|
||||
+ if (ret == -1) {
|
||||
+ xchar u = (xchar) msdead2fltk(wbuf[0]);
|
||||
+ Fl::e_length = fl_utf8fromwc(buffer, 1024, &u, 1);
|
||||
+ buffer[Fl::e_length] = 0;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ // If we have two characters (or more) from ToUnicode(), that's
|
||||
+ // an invalid sequence. One character chould mean a proper symbol,
|
||||
+ // or it could mean a composed one. In both cases we need to call
|
||||
+ // ToUnicode() again to get something sane.
|
||||
+ if (i == 0)
|
||||
+ continue;
|
||||
+
|
||||
+ // We should now have something sane. Give whatever we have to the
|
||||
+ // application.
|
||||
+ Fl::e_length = fl_utf8fromwc(buffer, 1024, wbuf, ret);
|
||||
+ buffer[Fl::e_length] = 0;
|
||||
+ }
|
||||
+ } else if (uMsg == WM_CHAR || uMsg == WM_SYSCHAR) {
|
||||
xchar u = (xchar) wParam;
|
||||
// Fl::e_length = fl_unicode2utf(&u, 1, buffer);
|
||||
Fl::e_length = fl_utf8fromwc(buffer, 1024, &u, 1);
|
||||
buffer[Fl::e_length] = 0;
|
||||
+ } else {
|
||||
+ buffer[0] = 0;
|
||||
+ Fl::e_length = 0;
|
||||
+ }
|
||||
|
||||
-
|
||||
- } else if (Fl::e_keysym >= FL_KP && Fl::e_keysym <= FL_KP_Last) {
|
||||
- if (state & FL_NUM_LOCK) {
|
||||
- // Convert to regular keypress...
|
||||
- buffer[0] = Fl::e_keysym-FL_KP;
|
||||
- Fl::e_length = 1;
|
||||
- } else {
|
||||
- // Convert to special keypress...
|
||||
- buffer[0] = 0;
|
||||
- Fl::e_length = 0;
|
||||
+ // The keypad area is a bit odd in that we need to change the keysym
|
||||
+ // to properly indicate what the user meant, unlike other keys where
|
||||
+ // we normally change the text and keep keysym stable.
|
||||
+ if (Fl::e_keysym >= FL_KP && Fl::e_keysym <= FL_KP_Last) {
|
||||
+ // The initial mapping tables give us a keysym that corresponds to
|
||||
+ // numlock being on, so we only do something when it is off.
|
||||
+ if (!(state & FL_NUM_LOCK)) {
|
||||
switch (Fl::e_keysym) {
|
||||
case FL_KP + '0' :
|
||||
Fl::e_keysym = FL_Insert;
|
||||
@@ -1073,30 +1208,10 @@
|
||||
case FL_KP + '.' :
|
||||
Fl::e_keysym = FL_Delete;
|
||||
break;
|
||||
- case FL_KP + '/' :
|
||||
- case FL_KP + '*' :
|
||||
- case FL_KP + '-' :
|
||||
- case FL_KP + '+' :
|
||||
- buffer[0] = Fl::e_keysym-FL_KP;
|
||||
- Fl::e_length = 1;
|
||||
- break;
|
||||
}
|
||||
}
|
||||
- } else if ((lParam & (1<<31))==0) {
|
||||
-#ifdef FLTK_PREVIEW_DEAD_KEYS
|
||||
- if ((lParam & (1<<24))==0) { // clear if dead key (always?)
|
||||
- xchar u = (xchar) wParam;
|
||||
- Fl::e_length = fl_utf8fromwc(buffer, 1024, &u, 1);
|
||||
- buffer[Fl::e_length] = 0;
|
||||
- } else { // set if "extended key" (never printable?)
|
||||
- buffer[0] = 0;
|
||||
- Fl::e_length = 0;
|
||||
- }
|
||||
-#else
|
||||
- buffer[0] = 0;
|
||||
- Fl::e_length = 0;
|
||||
-#endif
|
||||
}
|
||||
+
|
||||
Fl::e_text = buffer;
|
||||
if (lParam & (1<<31)) { // key up events.
|
||||
if (Fl::handle(FL_KEYUP, window)) return 0;
|
||||
@@ -0,0 +1,286 @@
|
||||
diff -ur fltk-1.3.0r9619.org/FL/Fl_Widget.H fltk-1.3.0r9619/FL/Fl_Widget.H
|
||||
--- fltk-1.3.0r9619.org/FL/Fl_Widget.H 2012-04-23 22:12:06.000000000 +0200
|
||||
+++ fltk-1.3.0r9619/FL/Fl_Widget.H 2012-06-18 13:46:07.302320825 +0200
|
||||
@@ -171,6 +171,7 @@
|
||||
GROUP_RELATIVE = 1<<16, ///< position this widget relative to the parent group, not to the window
|
||||
COPIED_TOOLTIP = 1<<17, ///< the widget tooltip is internally copied, its destruction is handled by the widget
|
||||
FULLSCREEN = 1<<18, ///< a fullscreen window (Fl_Window)
|
||||
+ SIMPLE_KEYBOARD = 1<<19, ///< the widget wants simple, consistent keypresses and not advanced input (like character composition and CJK input)
|
||||
// (space for more flags)
|
||||
USERFLAG3 = 1<<29, ///< reserved for 3rd party extensions
|
||||
USERFLAG2 = 1<<30, ///< reserved for 3rd party extensions
|
||||
@@ -776,6 +777,35 @@
|
||||
*/
|
||||
void clear_changed() {flags_ &= ~CHANGED;}
|
||||
|
||||
+ /**
|
||||
+ Returns if the widget sees a simplified keyboard model or not.
|
||||
+
|
||||
+ Normally widgets get a full-featured keyboard model that is geared
|
||||
+ towards text input. This includes support for compose sequences and
|
||||
+ advanced input methods, commonly used for asian writing system. This
|
||||
+ system however has downsides in that extra graphic can be presented
|
||||
+ to the user and that a physical key press doesn't correspond directly
|
||||
+ to a FLTK event.
|
||||
+
|
||||
+ Widgets that need a direct correspondence between actual key events
|
||||
+ and those seen by the widget can swith to the simplified keyboard
|
||||
+ model.
|
||||
+
|
||||
+ \retval 0 if the widget uses the normal keyboard model
|
||||
+ \see set_changed(), clear_changed()
|
||||
+ */
|
||||
+ unsigned int simple_keyboard() const {return flags_&SIMPLE_KEYBOARD;}
|
||||
+
|
||||
+ /** Marks a widget to use the simple keyboard model.
|
||||
+ \see changed(), clear_changed()
|
||||
+ */
|
||||
+ void set_simple_keyboard() {flags_ |= SIMPLE_KEYBOARD;}
|
||||
+
|
||||
+ /** Marks a widget to use the normal keyboard model.
|
||||
+ \see changed(), set_changed()
|
||||
+ */
|
||||
+ void set_normal_keyboard() {flags_ &= ~SIMPLE_KEYBOARD;}
|
||||
+
|
||||
/** Gives the widget the keyboard focus.
|
||||
Tries to make this widget be the Fl::focus() widget, by first sending
|
||||
it an FL_FOCUS event, and if it returns non-zero, setting
|
||||
diff -ur fltk-1.3.0r9619.org/src/Fl.cxx fltk-1.3.0r9619/src/Fl.cxx
|
||||
--- fltk-1.3.0r9619.org/src/Fl.cxx 2012-03-23 17:47:53.000000000 +0100
|
||||
+++ fltk-1.3.0r9619/src/Fl.cxx 2012-06-18 13:46:07.303320877 +0200
|
||||
@@ -70,6 +70,8 @@
|
||||
extern double fl_mac_flush_and_wait(double time_to_wait, char in_idle);
|
||||
#endif // WIN32
|
||||
|
||||
+extern void fl_update_focus(void);
|
||||
+
|
||||
//
|
||||
// Globals...
|
||||
//
|
||||
@@ -876,6 +878,8 @@
|
||||
fl_oldfocus = p;
|
||||
}
|
||||
e_number = old_event;
|
||||
+ // let the platform code do what it needs
|
||||
+ fl_update_focus();
|
||||
}
|
||||
}
|
||||
|
||||
diff -ur fltk-1.3.0r9619.org/src/Fl_grab.cxx fltk-1.3.0r9619/src/Fl_grab.cxx
|
||||
--- fltk-1.3.0r9619.org/src/Fl_grab.cxx 2012-03-23 17:47:53.000000000 +0100
|
||||
+++ fltk-1.3.0r9619/src/Fl_grab.cxx 2012-06-18 13:46:07.303320877 +0200
|
||||
@@ -29,6 +29,7 @@
|
||||
// override_redirect, it does similar things on WIN32.
|
||||
|
||||
extern void fl_fix_focus(); // in Fl.cxx
|
||||
+void fl_update_focus(void);
|
||||
|
||||
#ifdef WIN32
|
||||
// We have to keep track of whether we have captured the mouse, since
|
||||
@@ -80,6 +81,7 @@
|
||||
#endif
|
||||
}
|
||||
grab_ = win;
|
||||
+ fl_update_focus();
|
||||
} else {
|
||||
if (grab_) {
|
||||
#ifdef WIN32
|
||||
@@ -98,6 +100,7 @@
|
||||
XFlush(fl_display);
|
||||
#endif
|
||||
grab_ = 0;
|
||||
+ fl_update_focus();
|
||||
fl_fix_focus();
|
||||
}
|
||||
}
|
||||
diff -ur fltk-1.3.0r9619.org/src/Fl_x.cxx fltk-1.3.0r9619/src/Fl_x.cxx
|
||||
--- fltk-1.3.0r9619.org/src/Fl_x.cxx 2012-06-18 13:46:07.205316173 +0200
|
||||
+++ fltk-1.3.0r9619/src/Fl_x.cxx 2012-06-18 13:46:18.216844629 +0200
|
||||
@@ -298,6 +298,7 @@
|
||||
Colormap fl_colormap;
|
||||
XIM fl_xim_im = 0;
|
||||
XIC fl_xim_ic = 0;
|
||||
+Window fl_xim_win = 0;
|
||||
char fl_is_over_the_spot = 0;
|
||||
static XRectangle status_area;
|
||||
|
||||
@@ -583,6 +584,65 @@
|
||||
if(xim_styles) XFree(xim_styles);
|
||||
}
|
||||
|
||||
+void fl_xim_deactivate(void);
|
||||
+
|
||||
+void fl_xim_activate(Window xid)
|
||||
+{
|
||||
+ if (!fl_xim_im)
|
||||
+ return;
|
||||
+
|
||||
+ // If the focused window has changed, then use the brute force method
|
||||
+ // of completely recreating the input context.
|
||||
+ if (fl_xim_win != xid) {
|
||||
+ fl_xim_deactivate();
|
||||
+
|
||||
+ fl_new_ic();
|
||||
+ fl_xim_win = xid;
|
||||
+
|
||||
+ XSetICValues(fl_xim_ic,
|
||||
+ XNFocusWindow, fl_xim_win,
|
||||
+ XNClientWindow, fl_xim_win,
|
||||
+ NULL);
|
||||
+ }
|
||||
+
|
||||
+ fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height);
|
||||
+}
|
||||
+
|
||||
+void fl_xim_deactivate(void)
|
||||
+{
|
||||
+ if (!fl_xim_ic)
|
||||
+ return;
|
||||
+
|
||||
+ XDestroyIC(fl_xim_ic);
|
||||
+ fl_xim_ic = NULL;
|
||||
+
|
||||
+ fl_xim_win = 0;
|
||||
+}
|
||||
+
|
||||
+extern Fl_Window *fl_xfocus;
|
||||
+
|
||||
+void fl_update_focus(void)
|
||||
+{
|
||||
+ Fl_Widget *focus;
|
||||
+
|
||||
+ focus = Fl::grab();
|
||||
+ if (!focus)
|
||||
+ focus = Fl::focus();
|
||||
+ if (!focus)
|
||||
+ return;
|
||||
+
|
||||
+ if (focus->simple_keyboard()) {
|
||||
+ fl_xim_deactivate();
|
||||
+ } else {
|
||||
+ // fl_xfocus should always be set if something has focus, but let's
|
||||
+ // play it safe
|
||||
+ if (!fl_xfocus || !fl_xid(fl_xfocus))
|
||||
+ return;
|
||||
+
|
||||
+ fl_xim_activate(fl_xid(fl_xfocus));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void fl_open_display() {
|
||||
if (fl_display) return;
|
||||
|
||||
@@ -917,10 +977,9 @@
|
||||
XEvent xevent = thisevent;
|
||||
fl_xevent = &thisevent;
|
||||
Window xid = xevent.xany.window;
|
||||
- static Window xim_win = 0;
|
||||
|
||||
if (fl_xim_ic && xevent.type == DestroyNotify &&
|
||||
- xid != xim_win && !fl_find(xid))
|
||||
+ xid != fl_xim_win && !fl_find(xid))
|
||||
{
|
||||
XIM xim_im;
|
||||
xim_im = XOpenIM(fl_display, NULL, NULL, NULL);
|
||||
@@ -935,48 +994,10 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
- if (fl_xim_ic && (xevent.type == FocusIn))
|
||||
- {
|
||||
-#define POOR_XIM
|
||||
-#ifdef POOR_XIM
|
||||
- if (xim_win != xid)
|
||||
- {
|
||||
- xim_win = xid;
|
||||
- XDestroyIC(fl_xim_ic);
|
||||
- fl_xim_ic = NULL;
|
||||
- fl_new_ic();
|
||||
- XSetICValues(fl_xim_ic,
|
||||
- XNFocusWindow, xevent.xclient.window,
|
||||
- XNClientWindow, xid,
|
||||
- NULL);
|
||||
- }
|
||||
- fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height);
|
||||
-#else
|
||||
- if (Fl::first_window() && Fl::first_window()->modal()) {
|
||||
- Window x = fl_xid(Fl::first_window());
|
||||
- if (x != xim_win) {
|
||||
- xim_win = x;
|
||||
- XSetICValues(fl_xim_ic,
|
||||
- XNFocusWindow, xim_win,
|
||||
- XNClientWindow, xim_win,
|
||||
- NULL);
|
||||
- fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height);
|
||||
- }
|
||||
- } else if (xim_win != xid && xid) {
|
||||
- xim_win = xid;
|
||||
- XSetICValues(fl_xim_ic,
|
||||
- XNFocusWindow, xevent.xclient.window,
|
||||
- XNClientWindow, xid,
|
||||
- //XNFocusWindow, xim_win,
|
||||
- //XNClientWindow, xim_win,
|
||||
- NULL);
|
||||
- fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height);
|
||||
- }
|
||||
-#endif
|
||||
+ if (fl_xim_ic) {
|
||||
+ if (XFilterEvent((XEvent *)&xevent, 0))
|
||||
+ return 1;
|
||||
}
|
||||
-
|
||||
- if ( XFilterEvent((XEvent *)&xevent, 0) )
|
||||
- return(1);
|
||||
|
||||
#if USE_XRANDR
|
||||
if( XRRUpdateConfiguration_f && xevent.type == randrEventBase + RRScreenChangeNotify) {
|
||||
@@ -1326,15 +1347,15 @@
|
||||
//static XComposeStatus compose;
|
||||
len = XLookupString((XKeyEvent*)&(xevent.xkey),
|
||||
buffer, buffer_len, &keysym, 0/*&compose*/);
|
||||
- if (keysym && keysym < 0x400) { // a character in latin-1,2,3,4 sets
|
||||
- // force it to type a character (not sure if this ever is needed):
|
||||
- // if (!len) {buffer[0] = char(keysym); len = 1;}
|
||||
- len = fl_utf8encode(XKeysymToUcs(keysym), buffer);
|
||||
- if (len < 1) len = 1;
|
||||
- // ignore all effects of shift on the keysyms, which makes it a lot
|
||||
- // easier to program shortcuts and is Windoze-compatible:
|
||||
- keysym = XKeycodeToKeysym(fl_display, keycode, 0);
|
||||
- }
|
||||
+ // XLookupString() is only defined to return Latin-1 (although it
|
||||
+ // often gives you more). To be safe, use our own lookups based on
|
||||
+ // keysym.
|
||||
+ len = fl_utf8encode(XKeysymToUcs(keysym), buffer);
|
||||
+ if (len < 1)
|
||||
+ len = 1;
|
||||
+ // ignore all effects of shift on the keysyms, which makes it a lot
|
||||
+ // easier to program shortcuts and is Windoze-compatable:
|
||||
+ keysym = XKeycodeToKeysym(fl_display, keycode, 0);
|
||||
}
|
||||
// MRS: Can't use Fl::event_state(FL_CTRL) since the state is not
|
||||
// set until set_event_xy() is called later...
|
||||
diff -ur fltk-1.3.0r9619.org/src/xutf8/imKStoUCS.c fltk-1.3.0r9619/src/xutf8/imKStoUCS.c
|
||||
--- fltk-1.3.0r9619.org/src/xutf8/imKStoUCS.c 2009-03-13 23:43:43.000000000 +0100
|
||||
+++ fltk-1.3.0r9619/src/xutf8/imKStoUCS.c 2012-06-18 13:46:07.304320930 +0200
|
||||
@@ -266,6 +266,12 @@
|
||||
0x20a8, 0x20a9, 0x20aa, 0x20ab, 0x20ac /* 0x20a8-0x20af */
|
||||
};
|
||||
|
||||
+static unsigned short const keysym_to_unicode_fe50_fe60[] = {
|
||||
+ 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0306, 0x0307, 0x0308, /* 0xfe50-0xfe57 */
|
||||
+ 0x030a, 0x030b, 0x030c, 0x0327, 0x0328, 0x1da5, 0x3099, 0x309a, /* 0xfe58-0xfe5f */
|
||||
+ 0x0323 /* 0xfe60-0xfe67 */
|
||||
+};
|
||||
+
|
||||
unsigned int
|
||||
KeySymToUcs4(KeySym keysym)
|
||||
{
|
||||
@@ -315,6 +321,8 @@
|
||||
return keysym_to_unicode_1e9f_1eff[keysym - 0x1e9f];
|
||||
else if (keysym > 0x209f && keysym < 0x20ad)
|
||||
return keysym_to_unicode_20a0_20ac[keysym - 0x20a0];
|
||||
+ else if (keysym > 0xfe4f && keysym < 0xfe61)
|
||||
+ return keysym_to_unicode_fe50_fe60[keysym - 0xfe50];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
diff -up fltk-1.3.2/CMakeLists.txt.clp-x11 fltk-1.3.2/CMakeLists.txt
|
||||
--- fltk-1.3.2/CMakeLists.txt.clp-x11 2012-09-13 16:19:01.000000000 +0200
|
||||
+++ fltk-1.3.2/CMakeLists.txt 2013-01-30 15:56:25.810663430 +0100
|
||||
@@ -515,6 +515,20 @@ else()
|
||||
endif(OPTION_USE_XINERAMA)
|
||||
|
||||
#######################################################################
|
||||
+if(X11_Xfixes_FOUND)
|
||||
+ option(OPTION_USE_XFIXES "use lib XFIXES" ON)
|
||||
+endif(X11_Xfixes_FOUND)
|
||||
+
|
||||
+if(OPTION_USE_XFIXES)
|
||||
+ set(HAVE_XFIXES ${X11_Xfixes_FOUND})
|
||||
+ include_directories(${X11_Xfixes_INCLUDE_PATH})
|
||||
+ list(APPEND FLTK_LDLIBS -lXfixes)
|
||||
+ set(FLTK_XFIXES_FOUND TRUE)
|
||||
+else()
|
||||
+ set(FLTK_XFIXES_FOUND FALSE)
|
||||
+endif(OPTION_USE_XFIXES)
|
||||
+
|
||||
+#######################################################################
|
||||
if(X11_Xft_FOUND)
|
||||
option(OPTION_USE_XFT "use lib Xft" ON)
|
||||
endif(X11_Xft_FOUND)
|
||||
diff -up fltk-1.3.2/configh.cmake.in.clp-x11 fltk-1.3.2/configh.cmake.in
|
||||
--- fltk-1.3.2/configh.cmake.in.clp-x11 2011-07-19 06:49:30.000000000 +0200
|
||||
+++ fltk-1.3.2/configh.cmake.in 2013-01-30 15:56:25.810663430 +0100
|
||||
@@ -108,6 +108,14 @@
|
||||
#define USE_XDBE HAVE_XDBE
|
||||
|
||||
/*
|
||||
+ * HAVE_XFIXES:
|
||||
+ *
|
||||
+ * Do we have the X fixes extension?
|
||||
+ */
|
||||
+
|
||||
+#cmakedefine01 HAVE_XFIXES
|
||||
+
|
||||
+/*
|
||||
* __APPLE_QUARTZ__:
|
||||
*
|
||||
* If __APPLE_QUARTZ__ is defined, FLTK will be
|
||||
diff -up fltk-1.3.2/configh.in.clp-x11 fltk-1.3.2/configh.in
|
||||
--- fltk-1.3.2/configh.in.clp-x11 2011-10-04 11:21:47.000000000 +0200
|
||||
+++ fltk-1.3.2/configh.in 2013-01-30 15:56:25.810663430 +0100
|
||||
@@ -108,6 +108,14 @@
|
||||
#define USE_XDBE HAVE_XDBE
|
||||
|
||||
/*
|
||||
+ * HAVE_XFIXES:
|
||||
+ *
|
||||
+ * Do we have the X fixes extension?
|
||||
+ */
|
||||
+
|
||||
+#define HAVE_XFIXES 0
|
||||
+
|
||||
+/*
|
||||
* __APPLE_QUARTZ__:
|
||||
*
|
||||
* All Apple implementations are now based on Quartz and Cocoa,
|
||||
diff -up fltk-1.3.2/configure.in.clp-x11 fltk-1.3.2/configure.in
|
||||
--- fltk-1.3.2/configure.in.clp-x11 2013-01-30 15:56:25.802663573 +0100
|
||||
+++ fltk-1.3.2/configure.in 2013-01-30 15:56:25.810663430 +0100
|
||||
@@ -999,6 +999,16 @@ case $uname_GUI in
|
||||
LIBS="-lXext $LIBS")
|
||||
fi
|
||||
|
||||
+ dnl Check for the Xfixes extension unless disabled...
|
||||
+ AC_ARG_ENABLE(xfixes, [ --enable-xfixes turn on Xfixes support [default=yes]])
|
||||
+
|
||||
+ if test x$enable_xfixes != xno; then
|
||||
+ AC_CHECK_HEADER(X11/extensions/Xfixes.h, AC_DEFINE(HAVE_XFIXES),,
|
||||
+ [#include <X11/Xlib.h>])
|
||||
+ AC_CHECK_LIB(Xfixes, XFixesQueryExtension,
|
||||
+ LIBS="-lXfixes $LIBS")
|
||||
+ fi
|
||||
+
|
||||
dnl Check for overlay visuals...
|
||||
AC_PATH_PROG(XPROP, xprop)
|
||||
AC_CACHE_CHECK(for X overlay visuals, ac_cv_have_overlay,
|
||||
diff -up fltk-1.3.2/fluid/CMakeLists.txt.clp-x11 fltk-1.3.2/fluid/CMakeLists.txt
|
||||
diff -up fltk-1.3.2/src/CMakeLists.txt.clp-x11 fltk-1.3.2/src/CMakeLists.txt
|
||||
--- fltk-1.3.2/src/CMakeLists.txt.clp-x11 2013-01-30 16:06:00.785430590 +0100
|
||||
+++ fltk-1.3.2/src/CMakeLists.txt 2013-01-30 16:06:17.883126642 +0100
|
||||
@@ -243,6 +243,10 @@ if(HAVE_XINERAMA)
|
||||
target_link_libraries(fltk ${X11_Xinerama_LIB})
|
||||
endif(HAVE_XINERAMA)
|
||||
|
||||
+if(HAVE_XFIXES)
|
||||
+ target_link_libraries(fltk ${X11_Xfixes_LIB})
|
||||
+endif(HAVE_XFIXES)
|
||||
+
|
||||
if(USE_XFT)
|
||||
target_link_libraries(fltk ${X11_Xft_LIB})
|
||||
endif(USE_XFT)
|
||||
diff -up fltk-1.3.2/src/Fl_x.cxx.clp-x11 fltk-1.3.2/src/Fl_x.cxx
|
||||
--- fltk-1.3.2/src/Fl_x.cxx.clp-x11 2013-01-30 15:56:25.793663733 +0100
|
||||
+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-30 16:03:37.355981103 +0100
|
||||
@@ -53,6 +53,12 @@ static XRRUpdateConfiguration_type XRRUp
|
||||
static int randrEventBase; // base of RandR-defined events
|
||||
#endif
|
||||
|
||||
+# if HAVE_XFIXES
|
||||
+# include <X11/extensions/Xfixes.h>
|
||||
+static int xfixes_event_base = 0;
|
||||
+static bool have_xfixes = false;
|
||||
+# endif
|
||||
+
|
||||
static Fl_Xlib_Graphics_Driver fl_xlib_driver;
|
||||
static Fl_Display_Device fl_xlib_display(&fl_xlib_driver);
|
||||
Fl_Display_Device *Fl_Display_Device::_display = &fl_xlib_display;// the platform display
|
||||
@@ -307,6 +313,9 @@ static Atom WM_PROTOCOLS;
|
||||
static Atom fl_MOTIF_WM_HINTS;
|
||||
static Atom TARGETS;
|
||||
static Atom CLIPBOARD;
|
||||
+static Atom TIMESTAMP;
|
||||
+static Atom PRIMARY_TIMESTAMP;
|
||||
+static Atom CLIPBOARD_TIMESTAMP;
|
||||
Atom fl_XdndAware;
|
||||
Atom fl_XdndSelection;
|
||||
Atom fl_XdndEnter;
|
||||
@@ -667,6 +676,9 @@ void fl_open_display(Display* d) {
|
||||
fl_MOTIF_WM_HINTS = XInternAtom(d, "_MOTIF_WM_HINTS", 0);
|
||||
TARGETS = XInternAtom(d, "TARGETS", 0);
|
||||
CLIPBOARD = XInternAtom(d, "CLIPBOARD", 0);
|
||||
+ TIMESTAMP = XInternAtom(d, "TIMESTAMP", 0);
|
||||
+ PRIMARY_TIMESTAMP = XInternAtom(d, "PRIMARY_TIMESTAMP", 0);
|
||||
+ CLIPBOARD_TIMESTAMP = XInternAtom(d, "CLIPBOARD_TIMESTAMP", 0);
|
||||
fl_XdndAware = XInternAtom(d, "XdndAware", 0);
|
||||
fl_XdndSelection = XInternAtom(d, "XdndSelection", 0);
|
||||
fl_XdndEnter = XInternAtom(d, "XdndEnter", 0);
|
||||
@@ -713,6 +725,15 @@ void fl_open_display(Display* d) {
|
||||
#if !USE_COLORMAP
|
||||
Fl::visual(FL_RGB);
|
||||
#endif
|
||||
+
|
||||
+#if HAVE_XFIXES
|
||||
+ int error_base;
|
||||
+ if (XFixesQueryExtension(fl_display, &xfixes_event_base, &error_base))
|
||||
+ have_xfixes = true;
|
||||
+ else
|
||||
+ have_xfixes = false;
|
||||
+#endif
|
||||
+
|
||||
#if USE_XRANDR
|
||||
void *libxrandr_addr = dlopen("libXrandr.so.2", RTLD_LAZY);
|
||||
if (!libxrandr_addr) libxrandr_addr = dlopen("libXrandr.so", RTLD_LAZY);
|
||||
@@ -901,6 +922,102 @@ void Fl::copy(const char *stuff, int len
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
+// Code for tracking clipboard changes:
|
||||
+
|
||||
+static Time primary_timestamp = -1;
|
||||
+static Time clipboard_timestamp = -1;
|
||||
+
|
||||
+extern bool fl_clipboard_notify_empty(void);
|
||||
+extern void fl_trigger_clipboard_notify(int source);
|
||||
+
|
||||
+static void poll_clipboard_owner(void) {
|
||||
+ Window xid;
|
||||
+
|
||||
+#if HAVE_XFIXES
|
||||
+ // No polling needed with Xfixes
|
||||
+ if (have_xfixes)
|
||||
+ return;
|
||||
+#endif
|
||||
+
|
||||
+ // No one is interested, so no point polling
|
||||
+ if (fl_clipboard_notify_empty())
|
||||
+ return;
|
||||
+
|
||||
+ // We need a window for this to work
|
||||
+ if (!Fl::first_window())
|
||||
+ return;
|
||||
+ xid = fl_xid(Fl::first_window());
|
||||
+ if (!xid)
|
||||
+ return;
|
||||
+
|
||||
+ // Request an update of the selection time for both the primary and
|
||||
+ // clipboard selections. Magic continues when we get a SelectionNotify.
|
||||
+ if (!fl_i_own_selection[0])
|
||||
+ XConvertSelection(fl_display, XA_PRIMARY, TIMESTAMP, PRIMARY_TIMESTAMP,
|
||||
+ xid, fl_event_time);
|
||||
+ if (!fl_i_own_selection[1])
|
||||
+ XConvertSelection(fl_display, CLIPBOARD, TIMESTAMP, CLIPBOARD_TIMESTAMP,
|
||||
+ xid, fl_event_time);
|
||||
+}
|
||||
+
|
||||
+static void clipboard_timeout(void *data)
|
||||
+{
|
||||
+ // No one is interested, so stop polling
|
||||
+ if (fl_clipboard_notify_empty())
|
||||
+ return;
|
||||
+
|
||||
+ poll_clipboard_owner();
|
||||
+
|
||||
+ Fl::repeat_timeout(0.5, clipboard_timeout);
|
||||
+}
|
||||
+
|
||||
+static void handle_clipboard_timestamp(int clipboard, Time time)
|
||||
+{
|
||||
+ Time *timestamp;
|
||||
+
|
||||
+ timestamp = clipboard ? &clipboard_timestamp : &primary_timestamp;
|
||||
+
|
||||
+#if HAVE_XFIXES
|
||||
+ if (!have_xfixes)
|
||||
+#endif
|
||||
+ {
|
||||
+ // Initial scan, just store the value
|
||||
+ if (*timestamp == (Time)-1) {
|
||||
+ *timestamp = time;
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Same selection
|
||||
+ if (time == *timestamp)
|
||||
+ return;
|
||||
+
|
||||
+ *timestamp = time;
|
||||
+
|
||||
+ // Something happened! Let's tell someone!
|
||||
+ fl_trigger_clipboard_notify(clipboard);
|
||||
+}
|
||||
+
|
||||
+void fl_clipboard_notify_change() {
|
||||
+ // Reset the timestamps if we've going idle so that you don't
|
||||
+ // get a bogus immediate trigger next time they're activated.
|
||||
+ if (fl_clipboard_notify_empty()) {
|
||||
+ primary_timestamp = -1;
|
||||
+ clipboard_timestamp = -1;
|
||||
+ } else {
|
||||
+#if HAVE_XFIXES
|
||||
+ if (!have_xfixes)
|
||||
+#endif
|
||||
+ {
|
||||
+ poll_clipboard_owner();
|
||||
+
|
||||
+ if (!Fl::has_timeout(clipboard_timeout))
|
||||
+ Fl::add_timeout(0.5, clipboard_timeout);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+////////////////////////////////////////////////////////////////
|
||||
|
||||
const XEvent* fl_xevent; // the current x event
|
||||
ulong fl_event_time; // the last timestamp from an x event
|
||||
@@ -1024,7 +1141,6 @@ int fl_handle(const XEvent& thisevent)
|
||||
return 0;
|
||||
|
||||
case SelectionNotify: {
|
||||
- if (!fl_selection_requestor) return 0;
|
||||
static unsigned char* buffer = 0;
|
||||
if (buffer) {XFree(buffer); buffer = 0;}
|
||||
long bytesread = 0;
|
||||
@@ -1040,6 +1156,19 @@ int fl_handle(const XEvent& thisevent)
|
||||
bytesread/4, 65536, 1, 0,
|
||||
&actual, &format, &count, &remaining,
|
||||
&portion)) break; // quit on error
|
||||
+
|
||||
+ if ((fl_xevent->xselection.property == PRIMARY_TIMESTAMP) ||
|
||||
+ (fl_xevent->xselection.property == CLIPBOARD_TIMESTAMP)) {
|
||||
+ if (portion && format == 32 && count == 1) {
|
||||
+ Time t = *(unsigned int*)portion;
|
||||
+ if (fl_xevent->xselection.property == CLIPBOARD_TIMESTAMP)
|
||||
+ handle_clipboard_timestamp(1, t);
|
||||
+ else
|
||||
+ handle_clipboard_timestamp(0, t);
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
if (actual == TARGETS || actual == XA_ATOM) {
|
||||
Atom type = XA_STRING;
|
||||
for (unsigned i = 0; i<count; i++) {
|
||||
@@ -1076,6 +1205,9 @@ int fl_handle(const XEvent& thisevent)
|
||||
buffer[bytesread] = 0;
|
||||
convert_crlf(buffer, bytesread);
|
||||
}
|
||||
+
|
||||
+ if (!fl_selection_requestor) return 0;
|
||||
+
|
||||
Fl::e_text = buffer ? (char*)buffer : (char *)"";
|
||||
Fl::e_length = bytesread;
|
||||
int old_event = Fl::e_number;
|
||||
@@ -1096,6 +1228,7 @@ int fl_handle(const XEvent& thisevent)
|
||||
case SelectionClear: {
|
||||
int clipboard = fl_xevent->xselectionclear.selection == CLIPBOARD;
|
||||
fl_i_own_selection[clipboard] = 0;
|
||||
+ poll_clipboard_owner();
|
||||
return 1;}
|
||||
|
||||
case SelectionRequest: {
|
||||
@@ -1308,6 +1441,9 @@ int fl_handle(const XEvent& thisevent)
|
||||
case FocusIn:
|
||||
if (fl_xim_ic) XSetICFocus(fl_xim_ic);
|
||||
event = FL_FOCUS;
|
||||
+ // If the user has toggled from another application to this one,
|
||||
+ // then it's a good time to check for clipboard changes.
|
||||
+ poll_clipboard_owner();
|
||||
break;
|
||||
|
||||
case FocusOut:
|
||||
@@ -1676,6 +1812,25 @@ int fl_handle(const XEvent& thisevent)
|
||||
}
|
||||
}
|
||||
|
||||
+#if HAVE_XFIXES
|
||||
+ switch (xevent.type - xfixes_event_base) {
|
||||
+ case XFixesSelectionNotify: {
|
||||
+ // Someone feeding us bogus events?
|
||||
+ if (!have_xfixes)
|
||||
+ return true;
|
||||
+
|
||||
+ XFixesSelectionNotifyEvent *selection_notify = (XFixesSelectionNotifyEvent *)&xevent;
|
||||
+
|
||||
+ if ((selection_notify->selection == XA_PRIMARY) && !fl_i_own_selection[0])
|
||||
+ handle_clipboard_timestamp(0, selection_notify->selection_timestamp);
|
||||
+ else if ((selection_notify->selection == CLIPBOARD) && !fl_i_own_selection[1])
|
||||
+ handle_clipboard_timestamp(1, selection_notify->selection_timestamp);
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
return Fl::handle(event, window);
|
||||
}
|
||||
|
||||
@@ -1995,6 +2150,16 @@ void Fl_X::make_xid(Fl_Window* win, XVis
|
||||
XChangeProperty(fl_display, xp->xid, net_wm_type, XA_ATOM, 32, PropModeReplace, (unsigned char*)&net_wm_type_kind, 1);
|
||||
}
|
||||
|
||||
+#if HAVE_XFIXES
|
||||
+ // register for clipboard change notifications
|
||||
+ if (have_xfixes && !win->parent()) {
|
||||
+ XFixesSelectSelectionInput(fl_display, xp->xid, XA_PRIMARY,
|
||||
+ XFixesSetSelectionOwnerNotifyMask);
|
||||
+ XFixesSelectSelectionInput(fl_display, xp->xid, CLIPBOARD,
|
||||
+ XFixesSetSelectionOwnerNotifyMask);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
XMapWindow(fl_display, xp->xid);
|
||||
if (showit) {
|
||||
win->set_visible();
|
||||
diff -up fltk-1.3.2/test/CMakeLists.txt.clp-x11 fltk-1.3.2/test/CMakeLists.txt
|
||||
1623
contrib/packages/rpm/el6/SOURCES/fltk-1_v5.3.x-cursor.patch
Normal file
1623
contrib/packages/rpm/el6/SOURCES/fltk-1_v5.3.x-cursor.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,355 @@
|
||||
diff -up fltk-1.3.2/CMakeLists.txt.clp-x11 fltk-1.3.2/CMakeLists.txt
|
||||
--- fltk-1.3.2/CMakeLists.txt.clp-x11 2012-09-13 16:19:01.000000000 +0200
|
||||
+++ fltk-1.3.2/CMakeLists.txt 2013-01-30 15:56:25.810663430 +0100
|
||||
@@ -515,6 +515,20 @@ else()
|
||||
endif(OPTION_USE_XINERAMA)
|
||||
|
||||
#######################################################################
|
||||
+if(X11_Xfixes_FOUND)
|
||||
+ option(OPTION_USE_XFIXES "use lib XFIXES" ON)
|
||||
+endif(X11_Xfixes_FOUND)
|
||||
+
|
||||
+if(OPTION_USE_XFIXES)
|
||||
+ set(HAVE_XFIXES ${X11_Xfixes_FOUND})
|
||||
+ include_directories(${X11_Xfixes_INCLUDE_PATH})
|
||||
+ list(APPEND FLTK_LDLIBS -lXfixes)
|
||||
+ set(FLTK_XFIXES_FOUND TRUE)
|
||||
+else()
|
||||
+ set(FLTK_XFIXES_FOUND FALSE)
|
||||
+endif(OPTION_USE_XFIXES)
|
||||
+
|
||||
+#######################################################################
|
||||
if(X11_Xft_FOUND)
|
||||
option(OPTION_USE_XFT "use lib Xft" ON)
|
||||
endif(X11_Xft_FOUND)
|
||||
diff -up fltk-1.3.2/configh.cmake.in.clp-x11 fltk-1.3.2/configh.cmake.in
|
||||
--- fltk-1.3.2/configh.cmake.in.clp-x11 2011-07-19 06:49:30.000000000 +0200
|
||||
+++ fltk-1.3.2/configh.cmake.in 2013-01-30 15:56:25.810663430 +0100
|
||||
@@ -108,6 +108,14 @@
|
||||
#define USE_XDBE HAVE_XDBE
|
||||
|
||||
/*
|
||||
+ * HAVE_XFIXES:
|
||||
+ *
|
||||
+ * Do we have the X fixes extension?
|
||||
+ */
|
||||
+
|
||||
+#cmakedefine01 HAVE_XFIXES
|
||||
+
|
||||
+/*
|
||||
* __APPLE_QUARTZ__:
|
||||
*
|
||||
* If __APPLE_QUARTZ__ is defined, FLTK will be
|
||||
diff -up fltk-1.3.2/configh.in.clp-x11 fltk-1.3.2/configh.in
|
||||
--- fltk-1.3.2/configh.in.clp-x11 2011-10-04 11:21:47.000000000 +0200
|
||||
+++ fltk-1.3.2/configh.in 2013-01-30 15:56:25.810663430 +0100
|
||||
@@ -108,6 +108,14 @@
|
||||
#define USE_XDBE HAVE_XDBE
|
||||
|
||||
/*
|
||||
+ * HAVE_XFIXES:
|
||||
+ *
|
||||
+ * Do we have the X fixes extension?
|
||||
+ */
|
||||
+
|
||||
+#define HAVE_XFIXES 0
|
||||
+
|
||||
+/*
|
||||
* __APPLE_QUARTZ__:
|
||||
*
|
||||
* All Apple implementations are now based on Quartz and Cocoa,
|
||||
diff -up fltk-1.3.2/configure.in.clp-x11 fltk-1.3.2/configure.in
|
||||
--- fltk-1.3.2/configure.in.clp-x11 2013-01-30 15:56:25.802663573 +0100
|
||||
+++ fltk-1.3.2/configure.in 2013-01-30 15:56:25.810663430 +0100
|
||||
@@ -999,6 +999,16 @@ case $uname_GUI in
|
||||
LIBS="-lXext $LIBS")
|
||||
fi
|
||||
|
||||
+ dnl Check for the Xfixes extension unless disabled...
|
||||
+ AC_ARG_ENABLE(xfixes, [ --enable-xfixes turn on Xfixes support [default=yes]])
|
||||
+
|
||||
+ if test x$enable_xfixes != xno; then
|
||||
+ AC_CHECK_HEADER(X11/extensions/Xfixes.h, AC_DEFINE(HAVE_XFIXES),,
|
||||
+ [#include <X11/Xlib.h>])
|
||||
+ AC_CHECK_LIB(Xfixes, XFixesQueryExtension,
|
||||
+ LIBS="-lXfixes $LIBS")
|
||||
+ fi
|
||||
+
|
||||
dnl Check for overlay visuals...
|
||||
AC_PATH_PROG(XPROP, xprop)
|
||||
AC_CACHE_CHECK(for X overlay visuals, ac_cv_have_overlay,
|
||||
diff -up fltk-1.3.2/fluid/CMakeLists.txt.clp-x11 fltk-1.3.2/fluid/CMakeLists.txt
|
||||
diff -up fltk-1.3.2/src/CMakeLists.txt.clp-x11 fltk-1.3.2/src/CMakeLists.txt
|
||||
--- fltk-1.3.2/src/CMakeLists.txt.clp-x11 2013-01-30 16:06:00.785430590 +0100
|
||||
+++ fltk-1.3.2/src/CMakeLists.txt 2013-01-30 16:06:17.883126642 +0100
|
||||
@@ -243,6 +243,10 @@ if(HAVE_XINERAMA)
|
||||
target_link_libraries(fltk ${X11_Xinerama_LIB})
|
||||
endif(HAVE_XINERAMA)
|
||||
|
||||
+if(HAVE_XFIXES)
|
||||
+ target_link_libraries(fltk ${X11_Xfixes_LIB})
|
||||
+endif(HAVE_XFIXES)
|
||||
+
|
||||
if(USE_XFT)
|
||||
target_link_libraries(fltk ${X11_Xft_LIB})
|
||||
endif(USE_XFT)
|
||||
diff -up fltk-1.3.2/src/Fl_x.cxx.clp-x11 fltk-1.3.2/src/Fl_x.cxx
|
||||
--- fltk-1.3.2/src/Fl_x.cxx.clp-x11 2013-01-30 15:56:25.793663733 +0100
|
||||
+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-30 16:03:37.355981103 +0100
|
||||
@@ -53,6 +53,12 @@ static XRRUpdateConfiguration_type XRRUp
|
||||
static int randrEventBase; // base of RandR-defined events
|
||||
#endif
|
||||
|
||||
+# if HAVE_XFIXES
|
||||
+# include <X11/extensions/Xfixes.h>
|
||||
+static int xfixes_event_base = 0;
|
||||
+static bool have_xfixes = false;
|
||||
+# endif
|
||||
+
|
||||
static Fl_Xlib_Graphics_Driver fl_xlib_driver;
|
||||
static Fl_Display_Device fl_xlib_display(&fl_xlib_driver);
|
||||
Fl_Display_Device *Fl_Display_Device::_display = &fl_xlib_display;// the platform display
|
||||
@@ -307,6 +313,9 @@ static Atom WM_PROTOCOLS;
|
||||
static Atom fl_MOTIF_WM_HINTS;
|
||||
static Atom TARGETS;
|
||||
static Atom CLIPBOARD;
|
||||
+static Atom TIMESTAMP;
|
||||
+static Atom PRIMARY_TIMESTAMP;
|
||||
+static Atom CLIPBOARD_TIMESTAMP;
|
||||
Atom fl_XdndAware;
|
||||
Atom fl_XdndSelection;
|
||||
Atom fl_XdndEnter;
|
||||
@@ -667,6 +676,9 @@ void fl_open_display(Display* d) {
|
||||
fl_MOTIF_WM_HINTS = XInternAtom(d, "_MOTIF_WM_HINTS", 0);
|
||||
TARGETS = XInternAtom(d, "TARGETS", 0);
|
||||
CLIPBOARD = XInternAtom(d, "CLIPBOARD", 0);
|
||||
+ TIMESTAMP = XInternAtom(d, "TIMESTAMP", 0);
|
||||
+ PRIMARY_TIMESTAMP = XInternAtom(d, "PRIMARY_TIMESTAMP", 0);
|
||||
+ CLIPBOARD_TIMESTAMP = XInternAtom(d, "CLIPBOARD_TIMESTAMP", 0);
|
||||
fl_XdndAware = XInternAtom(d, "XdndAware", 0);
|
||||
fl_XdndSelection = XInternAtom(d, "XdndSelection", 0);
|
||||
fl_XdndEnter = XInternAtom(d, "XdndEnter", 0);
|
||||
@@ -713,6 +725,15 @@ void fl_open_display(Display* d) {
|
||||
#if !USE_COLORMAP
|
||||
Fl::visual(FL_RGB);
|
||||
#endif
|
||||
+
|
||||
+#if HAVE_XFIXES
|
||||
+ int error_base;
|
||||
+ if (XFixesQueryExtension(fl_display, &xfixes_event_base, &error_base))
|
||||
+ have_xfixes = true;
|
||||
+ else
|
||||
+ have_xfixes = false;
|
||||
+#endif
|
||||
+
|
||||
#if USE_XRANDR
|
||||
void *libxrandr_addr = dlopen("libXrandr.so.2", RTLD_LAZY);
|
||||
if (!libxrandr_addr) libxrandr_addr = dlopen("libXrandr.so", RTLD_LAZY);
|
||||
@@ -901,6 +922,107 @@ void Fl::copy(const char *stuff, int len
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
+// Code for tracking clipboard changes:
|
||||
+
|
||||
+static Time primary_timestamp = -1;
|
||||
+static Time clipboard_timestamp = -1;
|
||||
+
|
||||
+extern bool fl_clipboard_notify_empty(void);
|
||||
+extern void fl_trigger_clipboard_notify(int source);
|
||||
+
|
||||
+static void poll_clipboard_owner(void) {
|
||||
+ Window xid;
|
||||
+
|
||||
+#if HAVE_XFIXES
|
||||
+ // No polling needed with Xfixes
|
||||
+ if (have_xfixes)
|
||||
+ return;
|
||||
+#endif
|
||||
+
|
||||
+ // No one is interested, so no point polling
|
||||
+ if (fl_clipboard_notify_empty())
|
||||
+ return;
|
||||
+
|
||||
+ // We need a window for this to work
|
||||
+ if (!Fl::first_window())
|
||||
+ return;
|
||||
+ xid = fl_xid(Fl::first_window());
|
||||
+ if (!xid)
|
||||
+ return;
|
||||
+
|
||||
+ // Request an update of the selection time for both the primary and
|
||||
+ // clipboard selections. Magic continues when we get a SelectionNotify.
|
||||
+ if (!fl_i_own_selection[0])
|
||||
+ XConvertSelection(fl_display, XA_PRIMARY, TIMESTAMP, PRIMARY_TIMESTAMP,
|
||||
+ xid, fl_event_time);
|
||||
+ if (!fl_i_own_selection[1])
|
||||
+ XConvertSelection(fl_display, CLIPBOARD, TIMESTAMP, CLIPBOARD_TIMESTAMP,
|
||||
+ xid, fl_event_time);
|
||||
+}
|
||||
+
|
||||
+static void clipboard_timeout(void *data)
|
||||
+{
|
||||
+ // No one is interested, so stop polling
|
||||
+ if (fl_clipboard_notify_empty())
|
||||
+ return;
|
||||
+
|
||||
+ poll_clipboard_owner();
|
||||
+
|
||||
+ Fl::repeat_timeout(0.5, clipboard_timeout);
|
||||
+}
|
||||
+
|
||||
+static void handle_clipboard_timestamp(int clipboard, Time time)
|
||||
+{
|
||||
+ Time *timestamp;
|
||||
+
|
||||
+ timestamp = clipboard ? &clipboard_timestamp : &primary_timestamp;
|
||||
+
|
||||
+#if HAVE_XFIXES
|
||||
+ if (!have_xfixes)
|
||||
+#endif
|
||||
+ {
|
||||
+ // Initial scan, just store the value
|
||||
+ if (*timestamp == (Time)-1) {
|
||||
+ *timestamp = time;
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Same selection
|
||||
+ if (time == *timestamp)
|
||||
+ return;
|
||||
+
|
||||
+ *timestamp = time;
|
||||
+
|
||||
+ // The clipboard change is the event that caused us to request
|
||||
+ // the clipboard data, so use that time as the latest event.
|
||||
+ if (time > fl_event_time)
|
||||
+ fl_event_time = time;
|
||||
+
|
||||
+ // Something happened! Let's tell someone!
|
||||
+ fl_trigger_clipboard_notify(clipboard);
|
||||
+}
|
||||
+
|
||||
+void fl_clipboard_notify_change() {
|
||||
+ // Reset the timestamps if we've going idle so that you don't
|
||||
+ // get a bogus immediate trigger next time they're activated.
|
||||
+ if (fl_clipboard_notify_empty()) {
|
||||
+ primary_timestamp = -1;
|
||||
+ clipboard_timestamp = -1;
|
||||
+ } else {
|
||||
+#if HAVE_XFIXES
|
||||
+ if (!have_xfixes)
|
||||
+#endif
|
||||
+ {
|
||||
+ poll_clipboard_owner();
|
||||
+
|
||||
+ if (!Fl::has_timeout(clipboard_timeout))
|
||||
+ Fl::add_timeout(0.5, clipboard_timeout);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+////////////////////////////////////////////////////////////////
|
||||
|
||||
const XEvent* fl_xevent; // the current x event
|
||||
ulong fl_event_time; // the last timestamp from an x event
|
||||
@@ -1024,7 +1141,6 @@ int fl_handle(const XEvent& thisevent)
|
||||
return 0;
|
||||
|
||||
case SelectionNotify: {
|
||||
- if (!fl_selection_requestor) return 0;
|
||||
static unsigned char* buffer = 0;
|
||||
if (buffer) {XFree(buffer); buffer = 0;}
|
||||
long bytesread = 0;
|
||||
@@ -1040,6 +1156,19 @@ int fl_handle(const XEvent& thisevent)
|
||||
bytesread/4, 65536, 1, 0,
|
||||
&actual, &format, &count, &remaining,
|
||||
&portion)) break; // quit on error
|
||||
+
|
||||
+ if ((fl_xevent->xselection.property == PRIMARY_TIMESTAMP) ||
|
||||
+ (fl_xevent->xselection.property == CLIPBOARD_TIMESTAMP)) {
|
||||
+ if (portion && format == 32 && count == 1) {
|
||||
+ Time t = *(unsigned int*)portion;
|
||||
+ if (fl_xevent->xselection.property == CLIPBOARD_TIMESTAMP)
|
||||
+ handle_clipboard_timestamp(1, t);
|
||||
+ else
|
||||
+ handle_clipboard_timestamp(0, t);
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
if (actual == TARGETS || actual == XA_ATOM) {
|
||||
Atom type = XA_STRING;
|
||||
for (unsigned i = 0; i<count; i++) {
|
||||
@@ -1076,6 +1205,9 @@ int fl_handle(const XEvent& thisevent)
|
||||
buffer[bytesread] = 0;
|
||||
convert_crlf(buffer, bytesread);
|
||||
}
|
||||
+
|
||||
+ if (!fl_selection_requestor) return 0;
|
||||
+
|
||||
Fl::e_text = buffer ? (char*)buffer : (char *)"";
|
||||
Fl::e_length = bytesread;
|
||||
int old_event = Fl::e_number;
|
||||
@@ -1096,6 +1228,7 @@ int fl_handle(const XEvent& thisevent)
|
||||
case SelectionClear: {
|
||||
int clipboard = fl_xevent->xselectionclear.selection == CLIPBOARD;
|
||||
fl_i_own_selection[clipboard] = 0;
|
||||
+ poll_clipboard_owner();
|
||||
return 1;}
|
||||
|
||||
case SelectionRequest: {
|
||||
@@ -1308,6 +1441,9 @@ int fl_handle(const XEvent& thisevent)
|
||||
case FocusIn:
|
||||
if (fl_xim_ic) XSetICFocus(fl_xim_ic);
|
||||
event = FL_FOCUS;
|
||||
+ // If the user has toggled from another application to this one,
|
||||
+ // then it's a good time to check for clipboard changes.
|
||||
+ poll_clipboard_owner();
|
||||
break;
|
||||
|
||||
case FocusOut:
|
||||
@@ -1676,6 +1812,25 @@ int fl_handle(const XEvent& thisevent)
|
||||
}
|
||||
}
|
||||
|
||||
+#if HAVE_XFIXES
|
||||
+ switch (xevent.type - xfixes_event_base) {
|
||||
+ case XFixesSelectionNotify: {
|
||||
+ // Someone feeding us bogus events?
|
||||
+ if (!have_xfixes)
|
||||
+ return true;
|
||||
+
|
||||
+ XFixesSelectionNotifyEvent *selection_notify = (XFixesSelectionNotifyEvent *)&xevent;
|
||||
+
|
||||
+ if ((selection_notify->selection == XA_PRIMARY) && !fl_i_own_selection[0])
|
||||
+ handle_clipboard_timestamp(0, selection_notify->selection_timestamp);
|
||||
+ else if ((selection_notify->selection == CLIPBOARD) && !fl_i_own_selection[1])
|
||||
+ handle_clipboard_timestamp(1, selection_notify->selection_timestamp);
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
return Fl::handle(event, window);
|
||||
}
|
||||
|
||||
@@ -1995,6 +2150,16 @@ void Fl_X::make_xid(Fl_Window* win, XVis
|
||||
XChangeProperty(fl_display, xp->xid, net_wm_type, XA_ATOM, 32, PropModeReplace, (unsigned char*)&net_wm_type_kind, 1);
|
||||
}
|
||||
|
||||
+#if HAVE_XFIXES
|
||||
+ // register for clipboard change notifications
|
||||
+ if (have_xfixes && !win->parent()) {
|
||||
+ XFixesSelectSelectionInput(fl_display, xp->xid, XA_PRIMARY,
|
||||
+ XFixesSetSelectionOwnerNotifyMask);
|
||||
+ XFixesSelectSelectionInput(fl_display, xp->xid, CLIPBOARD,
|
||||
+ XFixesSetSelectionOwnerNotifyMask);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
XMapWindow(fl_display, xp->xid);
|
||||
if (showit) {
|
||||
win->set_visible();
|
||||
diff -up fltk-1.3.2/test/CMakeLists.txt.clp-x11 fltk-1.3.2/test/CMakeLists.txt
|
||||
@@ -0,0 +1,375 @@
|
||||
diff -ur fltk-1.3.0r9619.org/configure.in fltk-1.3.0r9619/configure.in
|
||||
--- fltk-1.3.0r9619.org/configure.in 2012-04-22 04:45:09.000000000 +0200
|
||||
+++ fltk-1.3.0r9619/configure.in 2012-06-18 13:47:33.290447462 +0200
|
||||
@@ -865,6 +865,8 @@
|
||||
Darwin*)
|
||||
# MacOS X uses Cocoa for graphics.
|
||||
LIBS="$LIBS -framework Cocoa"
|
||||
+ # And some Carbon for keyboard handling
|
||||
+ LIBS="$LIBS -framework Carbon"
|
||||
|
||||
if test x$have_pthread = xyes; then
|
||||
AC_DEFINE(HAVE_PTHREAD)
|
||||
diff -ur fltk-1.3.0r9619.org/src/Fl_cocoa.mm fltk-1.3.0r9619/src/Fl_cocoa.mm
|
||||
--- fltk-1.3.0r9619.org/src/Fl_cocoa.mm 2012-06-16 10:49:52.000000000 +0200
|
||||
+++ fltk-1.3.0r9619/src/Fl_cocoa.mm 2012-06-18 13:47:42.944910782 +0200
|
||||
@@ -53,6 +53,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
+#import <Carbon/Carbon.h>
|
||||
|
||||
#ifndef NSINTEGER_DEFINED // appears with 10.5 in NSObjCRuntime.h
|
||||
#if defined(__LP64__) && __LP64__
|
||||
@@ -114,6 +115,8 @@
|
||||
extern Fl_Window* fl_xmousewin;
|
||||
#endif
|
||||
|
||||
+bool use_simple_keyboard = false;
|
||||
+
|
||||
enum { FLTKTimerEvent = 1, FLTKDataReadyEvent };
|
||||
|
||||
|
||||
@@ -130,6 +133,39 @@
|
||||
{
|
||||
}
|
||||
|
||||
+// Undocumented voodoo. Taken from Mozilla.
|
||||
+#define ENABLE_ROMAN_KYBDS_ONLY -23
|
||||
+
|
||||
+void fl_update_focus(void)
|
||||
+{
|
||||
+ Fl_Widget *focus;
|
||||
+
|
||||
+ focus = Fl::grab();
|
||||
+ if (!focus)
|
||||
+ focus = Fl::focus();
|
||||
+ if (!focus)
|
||||
+ return;
|
||||
+
|
||||
+ if (focus->simple_keyboard())
|
||||
+ use_simple_keyboard = true;
|
||||
+ else
|
||||
+ use_simple_keyboard = false;
|
||||
+
|
||||
+ // Force a "Roman" or "ASCII" keyboard, which both the Mozilla and
|
||||
+ // Safari people seem to think implies turning off advanced IME stuff
|
||||
+ // (see nsTSMManager::SyncKeyScript in Mozilla and enableSecureTextInput
|
||||
+ // in Safari/Webcore). Should be good enough for us then...
|
||||
+#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5)
|
||||
+ CFArrayRef inputSources = TISCreateASCIICapableInputSourceList();
|
||||
+ TSMSetDocumentProperty(TSMGetActiveDocument(),
|
||||
+ kTSMDocumentEnabledInputSourcesPropertyTag,
|
||||
+ sizeof(CFArrayRef), &inputSources);
|
||||
+ CFRelease(inputSources);
|
||||
+#else
|
||||
+ KeyScript(use_simple_keyboard ? ENABLE_ROMAN_KYBDS_ONLY : smKeyEnableKybds);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* Mac keyboard lookup table
|
||||
*/
|
||||
@@ -908,6 +944,25 @@
|
||||
}
|
||||
@end
|
||||
|
||||
+static const char* cocoaDead2FLTK(const char *in)
|
||||
+{
|
||||
+ if (strcmp(in, "\140") == 0) // GRAVE ACCENT
|
||||
+ return "\314\200"; // COMBINING GRAVE ACCENT
|
||||
+ if (strcmp(in, "\302\264") == 0) // ACUTE ACCENT
|
||||
+ return "\314\201"; // COMBINING ACUTE ACCENT
|
||||
+ if (strcmp(in, "\136") == 0) // CIRCUMFLEX ACCENT
|
||||
+ return "\314\202"; // COMBINING CIRCUMFLEX ACCENT
|
||||
+ if (strcmp(in, "\176") == 0) // TILDE
|
||||
+ return "\314\203"; // COMBINING TILDE
|
||||
+ if (strcmp(in, "\302\250") == 0) // DIAERESIS
|
||||
+ return "\314\210"; // COMBINING DIAERESIS
|
||||
+ // FIXME: OS X dead key behaviour isn't documented and I don't have
|
||||
+ // any more keyboards to test with...
|
||||
+
|
||||
+ // hope that OS X gave us something proper to begin with
|
||||
+ return in;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
Handle cocoa keyboard events
|
||||
Events during a character composition sequence:
|
||||
@@ -1648,6 +1703,7 @@
|
||||
- (void)rightMouseDragged:(NSEvent *)theEvent;
|
||||
- (void)otherMouseDragged:(NSEvent *)theEvent;
|
||||
- (void)scrollWheel:(NSEvent *)theEvent;
|
||||
++ (NSString *)keyTranslate:(UInt16)keyCode withModifierFlags:(UInt32)modifierFlags;
|
||||
- (BOOL)handleKeyDown:(NSEvent *)theEvent;
|
||||
- (void)keyDown:(NSEvent *)theEvent;
|
||||
- (void)keyUp:(NSEvent *)theEvent;
|
||||
@@ -1726,6 +1782,130 @@
|
||||
- (void)scrollWheel:(NSEvent *)theEvent {
|
||||
cocoaMouseWheelHandler(theEvent);
|
||||
}
|
||||
++ (NSString *)keyTranslate:(UInt16)keyCode withModifierFlags:(UInt32)modifierFlags {
|
||||
+ const UCKeyboardLayout *layout;
|
||||
+ OSStatus err;
|
||||
+
|
||||
+ layout = NULL;
|
||||
+
|
||||
+#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5)
|
||||
+ TISInputSourceRef keyboard;
|
||||
+ CFDataRef uchr;
|
||||
+
|
||||
+ keyboard = TISCopyCurrentKeyboardInputSource();
|
||||
+ uchr = (CFDataRef)TISGetInputSourceProperty(keyboard,
|
||||
+ kTISPropertyUnicodeKeyLayoutData);
|
||||
+ if (uchr == NULL)
|
||||
+ return nil;
|
||||
+
|
||||
+ layout = (const UCKeyboardLayout*)CFDataGetBytePtr(uchr);
|
||||
+#else
|
||||
+ KeyboardLayoutRef old_layout;
|
||||
+ int kind;
|
||||
+
|
||||
+ err = KLGetCurrentKeyboardLayout(&old_layout);
|
||||
+ if (err != noErr)
|
||||
+ return nil;
|
||||
+
|
||||
+ err = KLGetKeyboardLayoutProperty(old_layout, kKLKind,
|
||||
+ (const void**)&kind);
|
||||
+ if (err != noErr)
|
||||
+ return nil;
|
||||
+
|
||||
+ // Old, crufty layout format?
|
||||
+ if (kind == kKLKCHRKind) {
|
||||
+ void *kchr_layout;
|
||||
+
|
||||
+ UInt32 chars, state;
|
||||
+ char buf[3];
|
||||
+
|
||||
+ unichar result[16];
|
||||
+ ByteCount in_len, out_len;
|
||||
+
|
||||
+ err = KLGetKeyboardLayoutProperty(old_layout, kKLKCHRData,
|
||||
+ (const void**)&kchr_layout);
|
||||
+ if (err != noErr)
|
||||
+ return nil;
|
||||
+
|
||||
+ state = 0;
|
||||
+
|
||||
+ keyCode &= 0x7f;
|
||||
+ modifierFlags &= 0xff00;
|
||||
+
|
||||
+ chars = KeyTranslate(kchr_layout, keyCode | modifierFlags, &state);
|
||||
+
|
||||
+ buf[0] = (chars >> 16) & 0xff;
|
||||
+ buf[1] = chars & 0xff;
|
||||
+ buf[2] = '\0';
|
||||
+
|
||||
+ if (buf[0] == '\0') {
|
||||
+ buf[0] = buf[1];
|
||||
+ buf[1] = '\0';
|
||||
+ }
|
||||
+
|
||||
+ // The data is now in some layout specific encoding. Need to convert
|
||||
+ // this to unicode.
|
||||
+
|
||||
+ ScriptCode script;
|
||||
+ TextEncoding encoding;
|
||||
+ TECObjectRef converter;
|
||||
+
|
||||
+ script = (ScriptCode)GetScriptManagerVariable(smKeyScript);
|
||||
+
|
||||
+ err = UpgradeScriptInfoToTextEncoding(script, kTextLanguageDontCare,
|
||||
+ kTextRegionDontCare, NULL,
|
||||
+ &encoding);
|
||||
+ if (err != noErr)
|
||||
+ return nil;
|
||||
+
|
||||
+ err = TECCreateConverter(&converter, encoding, kTextEncodingUnicodeV4_0);
|
||||
+ if (err != noErr)
|
||||
+ return nil;
|
||||
+
|
||||
+ in_len = strlen(buf);
|
||||
+ out_len = sizeof(result);
|
||||
+
|
||||
+ err = TECConvertText(converter, (ConstTextPtr)buf, in_len, &in_len,
|
||||
+ (TextPtr)result, out_len, &out_len);
|
||||
+
|
||||
+ TECDisposeConverter(converter);
|
||||
+
|
||||
+ if (err != noErr)
|
||||
+ return nil;
|
||||
+
|
||||
+ return [NSString stringWithCharacters:result
|
||||
+ length:(out_len / sizeof(unichar))];
|
||||
+ }
|
||||
+
|
||||
+ if ((kind != kKLKCHRuchrKind) && (kind != kKLuchrKind))
|
||||
+ return nil;
|
||||
+
|
||||
+ err = KLGetKeyboardLayoutProperty(old_layout, kKLuchrData,
|
||||
+ (const void**)&layout);
|
||||
+ if (err != noErr)
|
||||
+ return nil;
|
||||
+#endif
|
||||
+
|
||||
+ if (layout == NULL)
|
||||
+ return nil;
|
||||
+
|
||||
+ UInt32 dead_state;
|
||||
+ UniCharCount max_len, actual_len;
|
||||
+ UniChar string[255];
|
||||
+
|
||||
+ dead_state = 0;
|
||||
+ max_len = sizeof(string)/sizeof(*string);
|
||||
+
|
||||
+ modifierFlags = (modifierFlags >> 8) & 0xff;
|
||||
+
|
||||
+ err = UCKeyTranslate(layout, keyCode, kUCKeyActionDown, modifierFlags,
|
||||
+ LMGetKbdType(), 0, &dead_state, max_len, &actual_len,
|
||||
+ string);
|
||||
+ if (err != noErr)
|
||||
+ return nil;
|
||||
+
|
||||
+ return [NSString stringWithCharacters:string length:actual_len];
|
||||
+}
|
||||
- (BOOL)handleKeyDown:(NSEvent *)theEvent {
|
||||
//NSLog(@"handleKeyDown");
|
||||
fl_lock_function();
|
||||
@@ -1752,14 +1932,47 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
- if (!no_text_key && !(Fl::e_state & FL_META) ) {
|
||||
- // Don't send cmd-<key> to interpretKeyEvents because it beeps.
|
||||
+ if (!no_text_key) {
|
||||
+ // The simple keyboard model will ignore insertText, so we need to grab
|
||||
+ // the symbol directly from the event. Note that we still use setMarkedText.
|
||||
+ if (use_simple_keyboard) {
|
||||
+ NSString *simple_chars;
|
||||
+ UInt32 modifiers;
|
||||
+
|
||||
+ // We want a "normal" symbol out of the event, which basically means
|
||||
+ // we only respect the shift and alt/altgr modifiers. Cocoa can help
|
||||
+ // us if we only wanted shift, but as we also want alt/altgr, we'll
|
||||
+ // have to do some lookup ourselves. This matches our behaviour on
|
||||
+ // other platforms.
|
||||
+
|
||||
+ modifiers = 0;
|
||||
+ if ([theEvent modifierFlags] & NSAlphaShiftKeyMask)
|
||||
+ modifiers |= alphaLock;
|
||||
+ if ([theEvent modifierFlags] & NSShiftKeyMask)
|
||||
+ modifiers |= shiftKey;
|
||||
+ if ([theEvent modifierFlags] & NSAlternateKeyMask)
|
||||
+ modifiers |= optionKey;
|
||||
+
|
||||
+ simple_chars = [FLView keyTranslate:[theEvent keyCode]
|
||||
+ withModifierFlags:modifiers];
|
||||
+ if (simple_chars == nil) {
|
||||
+ // Something went wrong. Fall back to what Cocoa gave us...
|
||||
+ simple_chars = [theEvent charactersIgnoringModifiers];
|
||||
+ }
|
||||
+
|
||||
+ [FLView prepareEtext:simple_chars];
|
||||
+ }
|
||||
+
|
||||
// Then we can let the OS have a stab at it and see if it thinks it
|
||||
// should result in some text
|
||||
- NSText *edit = [[theEvent window] fieldEditor:YES forObject:nil];
|
||||
- in_key_event = true;
|
||||
- [edit interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
|
||||
- in_key_event = false;
|
||||
+
|
||||
+ // Don't send cmd-<key> to interpretKeyEvents because it beeps.
|
||||
+ if (!(Fl::e_state & FL_META)) {
|
||||
+ NSText *edit = [[theEvent window] fieldEditor:YES forObject:nil];
|
||||
+ in_key_event = true;
|
||||
+ [edit interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
|
||||
+ in_key_event = false;
|
||||
+ }
|
||||
}
|
||||
//NSLog(@"to text=%@ l=%d", [NSString stringWithUTF8String:Fl::e_text], Fl::e_length);
|
||||
int handled = Fl::handle(FL_KEYDOWN, window);
|
||||
@@ -1937,21 +2150,30 @@
|
||||
//NSLog(@"insertText: received=%@",received);
|
||||
|
||||
if (!in_key_event) fl_lock_function();
|
||||
+
|
||||
+ // Simple keyboard widgets do not want these side channel inputs.
|
||||
+ if (use_simple_keyboard)
|
||||
+ goto end;
|
||||
+
|
||||
[FLView prepareEtext:received];
|
||||
+
|
||||
// We can get called outside of key events (e.g. from the character
|
||||
- // palette). Transform such actions to FL_PASTE events.
|
||||
+ // palette). We need to fake our own key event at that point.
|
||||
if (!in_key_event) {
|
||||
Fl_Window *target = [(FLWindow*)[self window] getFl_Window];
|
||||
- Fl::handle(FL_PASTE, target);
|
||||
+ Fl::e_keysym = Fl::e_original_keysym = 0;
|
||||
+ Fl::handle(FL_KEYDOWN, target);
|
||||
// for some reason, the window does not redraw until the next mouse move or button push
|
||||
// sending a 'redraw()' or 'awake()' does not solve the issue!
|
||||
Fl::flush();
|
||||
}
|
||||
+
|
||||
+end:
|
||||
if (!in_key_event) fl_unlock_function();
|
||||
}
|
||||
|
||||
- (void)setMarkedText:(id)aString selectedRange:(NSRange)newSelection {
|
||||
- NSString *received;
|
||||
+ NSString *received, *current, *aggregate;
|
||||
if (newSelection.location == 0) {
|
||||
[self unmarkText];
|
||||
return;
|
||||
@@ -1962,11 +2184,47 @@
|
||||
received = (NSString*)aString;
|
||||
}
|
||||
//NSLog(@"setMarkedText: %@ %d %d",received,newSelection.location,newSelection.length);
|
||||
+
|
||||
+ fl_lock_function();
|
||||
+
|
||||
+ // Simple keyboard widgets generally do not want these side channel
|
||||
+ // inputs, but we have no other way of getting dead keys so we make
|
||||
+ // an exception in that case.
|
||||
+ if (use_simple_keyboard) {
|
||||
+ if (in_key_event && (Fl::e_length == 0)) {
|
||||
+ [FLView prepareEtext:received];
|
||||
+
|
||||
+ Fl::e_text = (char*)cocoaDead2FLTK(Fl::e_text);
|
||||
+ Fl::e_length = strlen(Fl::e_text);
|
||||
+ }
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
// This code creates the OS X behaviour of seeing dead keys as things
|
||||
// are being composed.
|
||||
+ //
|
||||
+ // Note: The concatenation thing is because of how OS X deals with
|
||||
+ // invalid sequences. At that point it will spit out one call
|
||||
+ // to insertText with the now aborted sequence, and one new
|
||||
+ // call to setMarkedText with the new sequence. Since we want
|
||||
+ // both to be visible, we need to concatenate.
|
||||
next_compose_length = newSelection.location;
|
||||
- [FLView prepareEtext:received];
|
||||
- //NSLog(@"Fl::e_text=%@ Fl::e_length=%d next_compose_length=%d", received, Fl::e_length, next_compose_length);
|
||||
+ current = [NSString stringWithUTF8String:Fl::e_text];
|
||||
+ aggregate = [current stringByAppendingString:received];
|
||||
+
|
||||
+ [FLView prepareEtext:aggregate];
|
||||
+ //NSLog(@"Fl::e_text=%@ Fl::e_length=%d next_compose_length=%d", aggregate, Fl::e_length, next_compose_length);
|
||||
+
|
||||
+ // We can get called outside of key events (e.g. from the character
|
||||
+ // palette). We need to fake our own key event at that point.
|
||||
+ if (!in_key_event) {
|
||||
+ Fl_Window *target = [(FLWindow*)[self window] getFl_Window];
|
||||
+ Fl::e_keysym = Fl::e_original_keysym = 0;
|
||||
+ Fl::handle(FL_KEYDOWN, target);
|
||||
+ }
|
||||
+
|
||||
+end:
|
||||
+ fl_unlock_function();
|
||||
}
|
||||
|
||||
- (void)unmarkText {
|
||||
275
contrib/packages/rpm/el6/SOURCES/nettle-2.7.1-ecc-cve.patch
Normal file
275
contrib/packages/rpm/el6/SOURCES/nettle-2.7.1-ecc-cve.patch
Normal file
@@ -0,0 +1,275 @@
|
||||
diff --git a/ecc-256.c b/ecc-256.c
|
||||
index 571cf73..07841b1 100644
|
||||
--- a/ecc-256.c
|
||||
+++ b/ecc-256.c
|
||||
@@ -108,7 +108,10 @@ ecc_256_modp (const struct ecc_curve *ecc, mp_limb_t *rp)
|
||||
u0 -= t;
|
||||
t = (u1 < cy);
|
||||
u1 -= cy;
|
||||
- u1 += cnd_add_n (t, rp + n - 4, ecc->p, 3);
|
||||
+
|
||||
+ cy = cnd_add_n (t, rp + n - 4, ecc->p, 2);
|
||||
+ u0 += cy;
|
||||
+ u1 += (u0 < cy);
|
||||
u1 -= (-t) & 0xffffffff;
|
||||
}
|
||||
rp[2] = u0;
|
||||
@@ -195,7 +198,7 @@ ecc_256_modq (const struct ecc_curve *ecc, mp_limb_t *rp)
|
||||
|
||||
/* Conditional add of p */
|
||||
u1 += t;
|
||||
- u2 += (t<<32) + (u0 < t);
|
||||
+ u2 += (t<<32) + (u1 < t);
|
||||
|
||||
t = cnd_add_n (t, rp + n - 4, ecc->q, 2);
|
||||
u1 += t;
|
||||
diff --git a/x86_64/ecc-384-modp.asm b/x86_64/ecc-384-modp.asm
|
||||
index 698838f..31b739e 100644
|
||||
--- a/x86_64/ecc-384-modp.asm
|
||||
+++ b/x86_64/ecc-384-modp.asm
|
||||
@@ -20,7 +20,7 @@ C MA 02111-1301, USA.
|
||||
.file "ecc-384-modp.asm"
|
||||
|
||||
define(<RP>, <%rsi>)
|
||||
-define(<D4>, <%rax>)
|
||||
+define(<D5>, <%rax>)
|
||||
define(<T0>, <%rbx>)
|
||||
define(<T1>, <%rcx>)
|
||||
define(<T2>, <%rdx>)
|
||||
@@ -35,8 +35,8 @@ define(<H4>, <%r13>)
|
||||
define(<H5>, <%r14>)
|
||||
define(<C2>, <%r15>)
|
||||
define(<C0>, H5) C Overlap
|
||||
-define(<D0>, RP) C Overlap
|
||||
-define(<TMP>, H4) C Overlap
|
||||
+define(<TMP>, RP) C Overlap
|
||||
+
|
||||
|
||||
PROLOGUE(nettle_ecc_384_modp)
|
||||
W64_ENTRY(2, 0)
|
||||
@@ -48,34 +48,38 @@ PROLOGUE(nettle_ecc_384_modp)
|
||||
push %r14
|
||||
push %r15
|
||||
|
||||
- C First get top 2 limbs, which need folding twice
|
||||
+ C First get top 2 limbs, which need folding twice.
|
||||
+ C B^10 = B^6 + B^4 + 2^32 (B-1)B^4.
|
||||
+ C We handle the terms as follow:
|
||||
C
|
||||
- C H5 H4
|
||||
- C -H5
|
||||
- C ------
|
||||
- C H0 D4
|
||||
+ C B^6: Folded immediatly.
|
||||
C
|
||||
- C Then shift right, (H1,H0,D4) <-- (H0,D4) << 32
|
||||
- C and add
|
||||
+ C B^4: Delayed, added in in the next folding.
|
||||
C
|
||||
- C H5 H4
|
||||
- C H1 H0
|
||||
- C ----------
|
||||
- C C2 H1 H0
|
||||
-
|
||||
- mov 80(RP), D4
|
||||
- mov 88(RP), H0
|
||||
- mov D4, H4
|
||||
- mov H0, H5
|
||||
- sub H0, D4
|
||||
- sbb $0, H0
|
||||
-
|
||||
- mov D4, T2
|
||||
- mov H0, H1
|
||||
- shl $32, H0
|
||||
- shr $32, T2
|
||||
+ C 2^32(B-1) B^4: Low half limb delayed until the next
|
||||
+ C folding. Top 1.5 limbs subtracted and shifter now, resulting
|
||||
+ C in 2.5 limbs. The low limb saved in D5, high 1.5 limbs added
|
||||
+ C in.
|
||||
+
|
||||
+ mov 80(RP), H4
|
||||
+ mov 88(RP), H5
|
||||
+ C Shift right 32 bits, into H1, H0
|
||||
+ mov H4, H0
|
||||
+ mov H5, H1
|
||||
+ mov H5, D5
|
||||
shr $32, H1
|
||||
- or T2, H0
|
||||
+ shl $32, D5
|
||||
+ shr $32, H0
|
||||
+ or D5, H0
|
||||
+
|
||||
+ C H1 H0
|
||||
+ C - H1 H0
|
||||
+ C --------
|
||||
+ C H1 H0 D5
|
||||
+ mov H0, D5
|
||||
+ neg D5
|
||||
+ sbb H1, H0
|
||||
+ sbb $0, H1
|
||||
|
||||
xor C2, C2
|
||||
add H4, H0
|
||||
@@ -114,118 +118,95 @@ PROLOGUE(nettle_ecc_384_modp)
|
||||
adc H3, T5
|
||||
adc $0, C0
|
||||
|
||||
- C H3 H2 H1 H0 0
|
||||
- C - H4 H3 H2 H1 H0
|
||||
- C ---------------
|
||||
- C H3 H2 H1 H0 D0
|
||||
-
|
||||
- mov XREG(D4), XREG(D4)
|
||||
- mov H0, D0
|
||||
- neg D0
|
||||
- sbb H1, H0
|
||||
- sbb H2, H1
|
||||
- sbb H3, H2
|
||||
- sbb H4, H3
|
||||
- sbb $0, D4
|
||||
-
|
||||
- C Shift right. High bits are sign, to be added to C0.
|
||||
- mov D4, TMP
|
||||
- sar $32, TMP
|
||||
- shl $32, D4
|
||||
- add TMP, C0
|
||||
-
|
||||
+ C Shift left, including low half of H4
|
||||
mov H3, TMP
|
||||
+ shl $32, H4
|
||||
shr $32, TMP
|
||||
- shl $32, H3
|
||||
- or TMP, D4
|
||||
+ or TMP, H4
|
||||
|
||||
mov H2, TMP
|
||||
+ shl $32, H3
|
||||
shr $32, TMP
|
||||
- shl $32, H2
|
||||
or TMP, H3
|
||||
|
||||
mov H1, TMP
|
||||
+ shl $32, H2
|
||||
shr $32, TMP
|
||||
- shl $32, H1
|
||||
or TMP, H2
|
||||
|
||||
mov H0, TMP
|
||||
+ shl $32, H1
|
||||
shr $32, TMP
|
||||
- shl $32, H0
|
||||
or TMP, H1
|
||||
|
||||
- mov D0, TMP
|
||||
- shr $32, TMP
|
||||
- shl $32, D0
|
||||
- or TMP, H0
|
||||
+ shl $32, H0
|
||||
+
|
||||
+ C H4 H3 H2 H1 H0 0
|
||||
+ C - H4 H3 H2 H1 H0
|
||||
+ C ---------------
|
||||
+ C H4 H3 H2 H1 H0 TMP
|
||||
|
||||
- add D0, T0
|
||||
+ mov H0, TMP
|
||||
+ neg TMP
|
||||
+ sbb H1, H0
|
||||
+ sbb H2, H1
|
||||
+ sbb H3, H2
|
||||
+ sbb H4, H3
|
||||
+ sbb $0, H4
|
||||
+
|
||||
+ add TMP, T0
|
||||
adc H0, T1
|
||||
adc H1, T2
|
||||
adc H2, T3
|
||||
adc H3, T4
|
||||
- adc D4, T5
|
||||
+ adc H4, T5
|
||||
adc $0, C0
|
||||
|
||||
C Remains to add in C2 and C0
|
||||
- C C0 C0<<32 (-2^32+1)C0
|
||||
- C C2 C2<<32 (-2^32+1)C2
|
||||
- C where C2 is always positive, while C0 may be -1.
|
||||
+ C Set H1, H0 = (2^96 - 2^32 + 1) C0
|
||||
mov C0, H0
|
||||
mov C0, H1
|
||||
- mov C0, H2
|
||||
- sar $63, C0 C Get sign
|
||||
shl $32, H1
|
||||
- sub H1, H0 C Gives borrow iff C0 > 0
|
||||
+ sub H1, H0
|
||||
sbb $0, H1
|
||||
- add C0, H2
|
||||
|
||||
+ C Set H3, H2 = (2^96 - 2^32 + 1) C2
|
||||
+ mov C2, H2
|
||||
+ mov C2, H3
|
||||
+ shl $32, H3
|
||||
+ sub H3, H2
|
||||
+ sbb $0, H3
|
||||
+ add C0, H2 C No carry. Could use lea trick
|
||||
+
|
||||
+ xor C0, C0
|
||||
add H0, T0
|
||||
adc H1, T1
|
||||
- adc $0, H2
|
||||
- adc $0, C0
|
||||
-
|
||||
- C Set (H1 H0) <-- C2 << 96 - C2 << 32 + 1
|
||||
- mov C2, H0
|
||||
- mov C2, H1
|
||||
- shl $32, H1
|
||||
- sub H1, H0
|
||||
- sbb $0, H1
|
||||
-
|
||||
- add H2, H0
|
||||
- adc C0, H1
|
||||
- adc C2, C0
|
||||
- mov C0, H2
|
||||
- sar $63, C0
|
||||
- add H0, T2
|
||||
- adc H1, T3
|
||||
- adc H2, T4
|
||||
- adc C0, T5
|
||||
- sbb C0, C0
|
||||
+ adc H2, T2
|
||||
+ adc H3, T3
|
||||
+ adc C2, T4
|
||||
+ adc D5, T5 C Value delayed from initial folding
|
||||
+ adc $0, C0 C Use sbb and switch sign?
|
||||
|
||||
C Final unlikely carry
|
||||
mov C0, H0
|
||||
mov C0, H1
|
||||
- mov C0, H2
|
||||
- sar $63, C0
|
||||
shl $32, H1
|
||||
sub H1, H0
|
||||
sbb $0, H1
|
||||
- add C0, H2
|
||||
|
||||
pop RP
|
||||
|
||||
- sub H0, T0
|
||||
+ add H0, T0
|
||||
mov T0, (RP)
|
||||
- sbb H1, T1
|
||||
+ adc H1, T1
|
||||
mov T1, 8(RP)
|
||||
- sbb H2, T2
|
||||
+ adc C0, T2
|
||||
mov T2, 16(RP)
|
||||
- sbb C0, T3
|
||||
+ adc $0, T3
|
||||
mov T3, 24(RP)
|
||||
- sbb C0, T4
|
||||
+ adc $0, T4
|
||||
mov T4, 32(RP)
|
||||
- sbb C0, T5
|
||||
+ adc $0, T5
|
||||
mov T5, 40(RP)
|
||||
|
||||
pop %r15
|
||||
554
contrib/packages/rpm/el6/SOURCES/pixmap_v2.patch
Normal file
554
contrib/packages/rpm/el6/SOURCES/pixmap_v2.patch
Normal file
@@ -0,0 +1,554 @@
|
||||
diff -ur fltk-1.3.2.org/FL/Fl_Image.H fltk-1.3.2/FL/Fl_Image.H
|
||||
--- fltk-1.3.2.org/FL/Fl_Image.H 2012-11-09 17:02:08.000000000 +0100
|
||||
+++ fltk-1.3.2/FL/Fl_Image.H 2013-01-16 14:40:51.543230638 +0100
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
class Fl_Widget;
|
||||
+class Fl_Pixmap;
|
||||
struct Fl_Menu_Item;
|
||||
struct Fl_Label;
|
||||
|
||||
@@ -203,6 +204,7 @@
|
||||
*/
|
||||
Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0) :
|
||||
Fl_Image(W,H,D), array(bits), alloc_array(0), id_(0), mask_(0) {data((const char **)&array, 1); ld(LD);}
|
||||
+ Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg=FL_GRAY);
|
||||
virtual ~Fl_RGB_Image();
|
||||
virtual Fl_Image *copy(int W, int H);
|
||||
Fl_Image *copy() { return copy(w(), h()); }
|
||||
diff -ur fltk-1.3.2.org/src/fl_draw_pixmap.cxx fltk-1.3.2/src/fl_draw_pixmap.cxx
|
||||
--- fltk-1.3.2.org/src/fl_draw_pixmap.cxx 2012-04-22 05:09:31.000000000 +0200
|
||||
+++ fltk-1.3.2/src/fl_draw_pixmap.cxx 2013-01-16 14:40:51.542230588 +0100
|
||||
@@ -58,99 +58,6 @@
|
||||
return 1;
|
||||
}
|
||||
|
||||
-#ifdef U64
|
||||
-
|
||||
-// The callback from fl_draw_image to get a row of data passes this:
|
||||
-struct pixmap_data {
|
||||
- int w, h;
|
||||
- const uchar*const* data;
|
||||
- union {
|
||||
- U64 colors[256];
|
||||
- U64* byte1[256];
|
||||
- };
|
||||
-};
|
||||
-
|
||||
-// callback for 1 byte per pixel:
|
||||
-static void cb1(void*v, int x, int y, int w, uchar* buf) {
|
||||
- pixmap_data& d = *(pixmap_data*)v;
|
||||
- const uchar* p = d.data[y]+x;
|
||||
- U64* q = (U64*)buf;
|
||||
- for (int X=w; X>0; X-=2, p += 2) {
|
||||
- if (X>1) {
|
||||
-# if WORDS_BIGENDIAN
|
||||
- *q++ = (d.colors[p[0]]<<32) | d.colors[p[1]];
|
||||
-# else
|
||||
- *q++ = (d.colors[p[1]]<<32) | d.colors[p[0]];
|
||||
-# endif
|
||||
- } else {
|
||||
-# if WORDS_BIGENDIAN
|
||||
- *q++ = d.colors[p[0]]<<32;
|
||||
-# else
|
||||
- *q++ = d.colors[p[0]];
|
||||
-# endif
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-// callback for 2 bytes per pixel:
|
||||
-static void cb2(void*v, int x, int y, int w, uchar* buf) {
|
||||
- pixmap_data& d = *(pixmap_data*)v;
|
||||
- const uchar* p = d.data[y]+2*x;
|
||||
- U64* q = (U64*)buf;
|
||||
- for (int X=w; X>0; X-=2) {
|
||||
- U64* colors = d.byte1[*p++];
|
||||
- int index = *p++;
|
||||
- if (X>1) {
|
||||
- U64* colors1 = d.byte1[*p++];
|
||||
- int index1 = *p++;
|
||||
-# if WORDS_BIGENDIAN
|
||||
- *q++ = (colors[index]<<32) | colors1[index1];
|
||||
-# else
|
||||
- *q++ = (colors1[index1]<<32) | colors[index];
|
||||
-# endif
|
||||
- } else {
|
||||
-# if WORDS_BIGENDIAN
|
||||
- *q++ = colors[index]<<32;
|
||||
-# else
|
||||
- *q++ = colors[index];
|
||||
-# endif
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-#else // U32
|
||||
-
|
||||
-// The callback from fl_draw_image to get a row of data passes this:
|
||||
-struct pixmap_data {
|
||||
- int w, h;
|
||||
- const uchar*const* data;
|
||||
- union {
|
||||
- U32 colors[256];
|
||||
- U32* byte1[256];
|
||||
- };
|
||||
-};
|
||||
-
|
||||
-// callback for 1 byte per pixel:
|
||||
-static void cb1(void*v, int x, int y, int w, uchar* buf) {
|
||||
- pixmap_data& d = *(pixmap_data*)v;
|
||||
- const uchar* p = d.data[y]+x;
|
||||
- U32* q = (U32*)buf;
|
||||
- for (int X=w; X--;) *q++ = d.colors[*p++];
|
||||
-}
|
||||
-
|
||||
-// callback for 2 bytes per pixel:
|
||||
-static void cb2(void*v, int x, int y, int w, uchar* buf) {
|
||||
- pixmap_data& d = *(pixmap_data*)v;
|
||||
- const uchar* p = d.data[y]+2*x;
|
||||
- U32* q = (U32*)buf;
|
||||
- for (int X=w; X--;) {
|
||||
- U32* colors = d.byte1[*p++];
|
||||
- *q++ = colors[*p++];
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-#endif // U64 else U32
|
||||
-
|
||||
uchar **fl_mask_bitmap; // if non-zero, create bitmap and store pointer here
|
||||
|
||||
/**
|
||||
@@ -200,34 +107,33 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
-/**
|
||||
- Draw XPM image data, with the top-left corner at the given position.
|
||||
- \see fl_draw_pixmap(char* const* data, int x, int y, Fl_Color bg)
|
||||
- */
|
||||
-int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
|
||||
- pixmap_data d;
|
||||
- if (!fl_measure_pixmap(cdata, d.w, d.h)) return 0;
|
||||
+int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg) {
|
||||
+ int w, h;
|
||||
const uchar*const* data = (const uchar*const*)(cdata+1);
|
||||
int transparent_index = -1;
|
||||
+
|
||||
+ if (!fl_measure_pixmap(cdata, w, h))
|
||||
+ return 0;
|
||||
+
|
||||
+ if ((chars_per_pixel < 1) || (chars_per_pixel > 2))
|
||||
+ return 0;
|
||||
+
|
||||
+ uchar colors[1<<(chars_per_pixel*8)][4];
|
||||
+
|
||||
#ifdef WIN32
|
||||
uchar *transparent_c = (uchar *)0; // such that transparent_c[0,1,2] are the RGB of the transparent color
|
||||
color_count = 0;
|
||||
used_colors = (uchar *)malloc(abs(ncolors)*3*sizeof(uchar));
|
||||
#endif
|
||||
|
||||
- if (ncolors < 0) { // FLTK (non standard) compressed colormap
|
||||
+ if (ncolors < 0) {
|
||||
+ // FLTK (non standard) compressed colormap
|
||||
ncolors = -ncolors;
|
||||
const uchar *p = *data++;
|
||||
// if first color is ' ' it is transparent (put it later to make
|
||||
// it not be transparent):
|
||||
if (*p == ' ') {
|
||||
- uchar* c = (uchar*)&d.colors[(int)' '];
|
||||
-#ifdef U64
|
||||
- *(U64*)c = 0;
|
||||
-# if WORDS_BIGENDIAN
|
||||
- c += 4;
|
||||
-# endif
|
||||
-#endif
|
||||
+ uchar* c = colors[(int)' '];
|
||||
transparent_index = ' ';
|
||||
Fl::get_color(bg, c[0], c[1], c[2]); c[3] = 0;
|
||||
#ifdef WIN32
|
||||
@@ -238,13 +144,7 @@
|
||||
}
|
||||
// read all the rest of the colors:
|
||||
for (int i=0; i < ncolors; i++) {
|
||||
- uchar* c = (uchar*)&d.colors[*p++];
|
||||
-#ifdef U64
|
||||
- *(U64*)c = 0;
|
||||
-# if WORDS_BIGENDIAN
|
||||
- c += 4;
|
||||
-# endif
|
||||
-#endif
|
||||
+ uchar* c = colors[*p++];
|
||||
#ifdef WIN32
|
||||
used_colors[3*color_count] = *p;
|
||||
used_colors[3*color_count+1] = *(p+1);
|
||||
@@ -254,69 +154,44 @@
|
||||
*c++ = *p++;
|
||||
*c++ = *p++;
|
||||
*c++ = *p++;
|
||||
-#ifdef __APPLE_QUARTZ__
|
||||
*c = 255;
|
||||
-#else
|
||||
- *c = 0;
|
||||
-#endif
|
||||
}
|
||||
- } else { // normal XPM colormap with names
|
||||
- if (chars_per_pixel>1) memset(d.byte1, 0, sizeof(d.byte1));
|
||||
+ } else {
|
||||
+ // normal XPM colormap with names
|
||||
for (int i=0; i<ncolors; i++) {
|
||||
const uchar *p = *data++;
|
||||
// the first 1 or 2 characters are the color index:
|
||||
int ind = *p++;
|
||||
uchar* c;
|
||||
- if (chars_per_pixel>1) {
|
||||
-#ifdef U64
|
||||
- U64* colors = d.byte1[ind];
|
||||
- if (!colors) colors = d.byte1[ind] = new U64[256];
|
||||
-#else
|
||||
- U32* colors = d.byte1[ind];
|
||||
- if (!colors) colors = d.byte1[ind] = new U32[256];
|
||||
-#endif
|
||||
- c = (uchar*)&colors[*p];
|
||||
- ind = (ind<<8)|*p++;
|
||||
- } else {
|
||||
- c = (uchar *)&d.colors[ind];
|
||||
- }
|
||||
+ if (chars_per_pixel>1)
|
||||
+ ind = (ind<<8)|*p++;
|
||||
+ c = colors[ind];
|
||||
// look for "c word", or last word if none:
|
||||
const uchar *previous_word = p;
|
||||
for (;;) {
|
||||
- while (*p && isspace(*p)) p++;
|
||||
- uchar what = *p++;
|
||||
- while (*p && !isspace(*p)) p++;
|
||||
- while (*p && isspace(*p)) p++;
|
||||
- if (!*p) {p = previous_word; break;}
|
||||
- if (what == 'c') break;
|
||||
- previous_word = p;
|
||||
- while (*p && !isspace(*p)) p++;
|
||||
+ while (*p && isspace(*p)) p++;
|
||||
+ uchar what = *p++;
|
||||
+ while (*p && !isspace(*p)) p++;
|
||||
+ while (*p && isspace(*p)) p++;
|
||||
+ if (!*p) {p = previous_word; break;}
|
||||
+ if (what == 'c') break;
|
||||
+ previous_word = p;
|
||||
+ while (*p && !isspace(*p)) p++;
|
||||
}
|
||||
-#ifdef U64
|
||||
- *(U64*)c = 0;
|
||||
-# if WORDS_BIGENDIAN
|
||||
- c += 4;
|
||||
-# endif
|
||||
-#endif
|
||||
-#ifdef __APPLE_QUARTZ__
|
||||
- c[3] = 255;
|
||||
-#endif
|
||||
int parse = fl_parse_color((const char*)p, c[0], c[1], c[2]);
|
||||
+ c[3] = 255;
|
||||
if (parse) {
|
||||
#ifdef WIN32
|
||||
- used_colors[3*color_count] = c[0];
|
||||
- used_colors[3*color_count+1] = c[1];
|
||||
- used_colors[3*color_count+2] = c[2];
|
||||
- color_count++;
|
||||
+ used_colors[3*color_count] = c[0];
|
||||
+ used_colors[3*color_count+1] = c[1];
|
||||
+ used_colors[3*color_count+2] = c[2];
|
||||
+ color_count++;
|
||||
#endif
|
||||
- }
|
||||
- else {
|
||||
+ } else {
|
||||
// assume "None" or "#transparent" for any errors
|
||||
- // "bg" should be transparent...
|
||||
- Fl::get_color(bg, c[0], c[1], c[2]);
|
||||
-#ifdef __APPLE_QUARTZ__
|
||||
+ // "bg" should be transparent...
|
||||
+ Fl::get_color(bg, c[0], c[1], c[2]);
|
||||
c[3] = 0;
|
||||
-#endif
|
||||
transparent_index = ind;
|
||||
#ifdef WIN32
|
||||
transparent_c = c;
|
||||
@@ -324,7 +199,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
- d.data = data;
|
||||
#ifdef WIN32
|
||||
if (transparent_c) {
|
||||
make_unused_color(transparent_c[0], transparent_c[1], transparent_c[2]);
|
||||
@@ -334,77 +208,76 @@
|
||||
make_unused_color(r, g, b);
|
||||
}
|
||||
#endif
|
||||
+
|
||||
+ U32 *q = (U32*)out;
|
||||
+ for (int Y = 0; Y < h; Y++) {
|
||||
+ const uchar* p = data[Y];
|
||||
+ if (chars_per_pixel <= 1) {
|
||||
+ for (int X = 0; X < w; X++)
|
||||
+ memcpy(q++, colors[*p++], 4);
|
||||
+ } else {
|
||||
+ for (int X = 0; X < w; X++) {
|
||||
+ int ind = (*p++)<<8;
|
||||
+ ind |= *p++;
|
||||
+ memcpy(q++, colors[ind], 4);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ Draw XPM image data, with the top-left corner at the given position.
|
||||
+ \see fl_draw_pixmap(char* const* data, int x, int y, Fl_Color bg)
|
||||
+ */
|
||||
+int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
|
||||
+ int w, h;
|
||||
+
|
||||
+ if (!fl_measure_pixmap(cdata, w, h))
|
||||
+ return 0;
|
||||
+
|
||||
+ uchar buffer[w*h*4];
|
||||
+
|
||||
+ if (!fl_convert_pixmap(cdata, buffer, bg))
|
||||
+ return 0;
|
||||
+
|
||||
+ // FIXME: Hack until fl_draw_image() supports alpha properly
|
||||
#ifdef __APPLE_QUARTZ__
|
||||
if (Fl_Surface_Device::surface() == Fl_Display_Device::display_device()) {
|
||||
- U32 *array = new U32[d.w * d.h], *q = array;
|
||||
- for (int Y = 0; Y < d.h; Y++) {
|
||||
- const uchar* p = data[Y];
|
||||
- if (chars_per_pixel <= 1) {
|
||||
- for (int X = 0; X < d.w; X++) {
|
||||
- *q++ = d.colors[*p++];
|
||||
- }
|
||||
- } else {
|
||||
- for (int X = 0; X < d.w; X++) {
|
||||
- U32* colors = (U32*)d.byte1[*p++];
|
||||
- *q++ = colors[*p++];
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- Fl_RGB_Image* rgb = new Fl_RGB_Image((uchar*)array, d.w, d.h, 4);
|
||||
+ Fl_RGB_Image* rgb = new Fl_RGB_Image(buffer, w, h, 4);
|
||||
rgb->draw(x, y);
|
||||
delete rgb;
|
||||
- delete[] array;
|
||||
- }
|
||||
- else {
|
||||
+ } else {
|
||||
#endif // __APPLE_QUARTZ__
|
||||
-
|
||||
// build the mask bitmap used by Fl_Pixmap:
|
||||
- if (fl_mask_bitmap && transparent_index >= 0) {
|
||||
- int W = (d.w+7)/8;
|
||||
- uchar* bitmap = new uchar[W * d.h];
|
||||
+ if (fl_mask_bitmap) {
|
||||
+ int W = (w+7)/8;
|
||||
+ uchar* bitmap = new uchar[W * h];
|
||||
*fl_mask_bitmap = bitmap;
|
||||
- for (int Y = 0; Y < d.h; Y++) {
|
||||
- const uchar* p = data[Y];
|
||||
- if (chars_per_pixel <= 1) {
|
||||
- int dw = d.w;
|
||||
- for (int X = 0; X < W; X++) {
|
||||
- uchar b = (dw-->0 && *p++ != transparent_index);
|
||||
- if (dw-->0 && *p++ != transparent_index) b |= 2;
|
||||
- if (dw-->0 && *p++ != transparent_index) b |= 4;
|
||||
- if (dw-->0 && *p++ != transparent_index) b |= 8;
|
||||
- if (dw-->0 && *p++ != transparent_index) b |= 16;
|
||||
- if (dw-->0 && *p++ != transparent_index) b |= 32;
|
||||
- if (dw-->0 && *p++ != transparent_index) b |= 64;
|
||||
- if (dw-->0 && *p++ != transparent_index) b |= 128;
|
||||
+ const uchar *p = &buffer[3];
|
||||
+ uchar b = 0;
|
||||
+ for (int Y = 0; Y < h; Y++) {
|
||||
+ b = 0;
|
||||
+ for (int X = 0, bit = 1; X < w; X++, p += 4) {
|
||||
+ if (*p > 127) b |= bit;
|
||||
+ bit <<= 1;
|
||||
+ if (bit > 0x80 || X == w-1) {
|
||||
*bitmap++ = b;
|
||||
- }
|
||||
- } else {
|
||||
- uchar b = 0, bit = 1;
|
||||
- for (int X = 0; X < d.w; X++) {
|
||||
- int ind = *p++;
|
||||
- ind = (ind<<8) | (*p++);
|
||||
- if (ind != transparent_index) b |= bit;
|
||||
-
|
||||
- if (bit < 128) bit <<= 1;
|
||||
- else {
|
||||
- *bitmap++ = b;
|
||||
- b = 0;
|
||||
- bit = 1;
|
||||
+ bit = 1;
|
||||
+ b = 0;
|
||||
}
|
||||
}
|
||||
-
|
||||
- if (bit > 1) *bitmap++ = b;
|
||||
}
|
||||
- }
|
||||
+
|
||||
}
|
||||
|
||||
- fl_draw_image(chars_per_pixel==1 ? cb1 : cb2, &d, x, y, d.w, d.h, 4);
|
||||
+ fl_draw_image(buffer, x, y, w, h, 4);
|
||||
+
|
||||
#ifdef __APPLE_QUARTZ__
|
||||
}
|
||||
#endif
|
||||
|
||||
- if (chars_per_pixel > 1) for (int i = 0; i < 256; i++) delete[] d.byte1[i];
|
||||
return 1;
|
||||
}
|
||||
|
||||
diff -ur fltk-1.3.2.org/src/Fl_Image.cxx fltk-1.3.2/src/Fl_Image.cxx
|
||||
--- fltk-1.3.2.org/src/Fl_Image.cxx 2012-11-09 17:02:08.000000000 +0100
|
||||
+++ fltk-1.3.2/src/Fl_Image.cxx 2013-01-16 14:41:38.404162795 +0100
|
||||
@@ -165,7 +165,22 @@
|
||||
//
|
||||
size_t Fl_RGB_Image::max_size_ = ~((size_t)0);
|
||||
|
||||
-/** The destructor free all memory and server resources that are used by the image. */
|
||||
+int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg);
|
||||
+
|
||||
+/** The constructor creates a new RGBA image from the specified Fl_Pixmap.
|
||||
+
|
||||
+ The RGBA image is built fully opaque except for the transparent area
|
||||
+ of the pixmap that is assigned the \par bg color with full transparency */
|
||||
+Fl_RGB_Image::Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg):
|
||||
+ Fl_Image(pxm->w(), pxm->h(), 4), id_(0), mask_(0)
|
||||
+{
|
||||
+ array = new uchar[w() * h() * d()];
|
||||
+ alloc_array = 1;
|
||||
+ fl_convert_pixmap(pxm->data(), (uchar*)array, bg);
|
||||
+ data((const char **)&array, 1);
|
||||
+}
|
||||
+
|
||||
+/** The destructor frees all memory and server resources that are used by the image. */
|
||||
Fl_RGB_Image::~Fl_RGB_Image() {
|
||||
uncache();
|
||||
if (alloc_array) delete[] (uchar *)array;
|
||||
diff -ur fltk-1.3.2.org/src/ps_image.cxx fltk-1.3.2/src/ps_image.cxx
|
||||
--- fltk-1.3.2.org/src/ps_image.cxx 2011-07-19 06:49:30.000000000 +0200
|
||||
+++ fltk-1.3.2/src/ps_image.cxx 2013-01-16 14:40:51.541228080 +0100
|
||||
@@ -185,72 +185,38 @@
|
||||
|
||||
extern uchar **fl_mask_bitmap;
|
||||
|
||||
+struct callback_data {
|
||||
+ const uchar *data;
|
||||
+ int D, LD;
|
||||
+};
|
||||
|
||||
-void Fl_PostScript_Graphics_Driver::draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD) {
|
||||
- double x = ix, y = iy, w = iw, h = ih;
|
||||
|
||||
- if (D<3){ //mono
|
||||
- draw_image_mono(data, ix, iy, iw, ih, D, LD);
|
||||
- return;
|
||||
- }
|
||||
+static void draw_image_cb(void *data, int x, int y, int w, uchar *buf) {
|
||||
+ struct callback_data *cb_data;
|
||||
+ const uchar *curdata;
|
||||
|
||||
+ cb_data = (struct callback_data*)data;
|
||||
+ curdata = cb_data->data + x*cb_data->D + y*cb_data->LD;
|
||||
|
||||
- int i,j, k;
|
||||
+ memcpy(buf, curdata, w*cb_data->D);
|
||||
+}
|
||||
|
||||
- fprintf(output,"save\n");
|
||||
|
||||
- const char * interpol;
|
||||
- if (lang_level_>1){
|
||||
- if (interpolate_)
|
||||
- interpol="true";
|
||||
- else
|
||||
- interpol="false";
|
||||
- if (mask && lang_level_>2)
|
||||
- fprintf(output, "%g %g %g %g %i %i %i %i %s CIM\n", x , y+h , w , -h , iw , ih, mx, my, interpol);
|
||||
- else
|
||||
- fprintf(output, "%g %g %g %g %i %i %s CII\n", x , y+h , w , -h , iw , ih, interpol);
|
||||
- } else
|
||||
- fprintf(output , "%g %g %g %g %i %i CI", x , y+h , w , -h , iw , ih);
|
||||
+void Fl_PostScript_Graphics_Driver::draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD) {
|
||||
+ if (D<3){ //mono
|
||||
+ draw_image_mono(data, ix, iy, iw, ih, D, LD);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
+ struct callback_data cb_data;
|
||||
|
||||
if (!LD) LD = iw*D;
|
||||
- uchar *curmask=mask;
|
||||
-
|
||||
- for (j=0; j<ih;j++){
|
||||
- if (mask){
|
||||
-
|
||||
- for (k=0;k<my/ih;k++){
|
||||
- for (i=0; i<((mx+7)/8);i++){
|
||||
- if (!(i%80)) fprintf(output, "\n");
|
||||
- fprintf(output, "%.2x",swap_byte(*curmask));
|
||||
- curmask++;
|
||||
- }
|
||||
- fprintf(output,"\n");
|
||||
- }
|
||||
- }
|
||||
- const uchar *curdata=data+j*LD;
|
||||
- for (i=0 ; i<iw ; i++) {
|
||||
- uchar r = curdata[0];
|
||||
- uchar g = curdata[1];
|
||||
- uchar b = curdata[2];
|
||||
- if (lang_level_<3 && D>3) { //can do mixing using bg_* colors)
|
||||
- unsigned int a2 = curdata[3]; //must be int
|
||||
- unsigned int a = 255-a2;
|
||||
- r = (a2 * r + bg_r * a)/255;
|
||||
- g = (a2 * g + bg_g * a)/255;
|
||||
- b = (a2 * b + bg_b * a)/255;
|
||||
- }
|
||||
- if (!(i%40)) fprintf(output, "\n");
|
||||
- fprintf(output, "%.2x%.2x%.2x", r, g, b);
|
||||
- curdata +=D;
|
||||
- }
|
||||
- fprintf(output,"\n");
|
||||
-
|
||||
- }
|
||||
-
|
||||
- fprintf(output," >\nrestore\n" );
|
||||
|
||||
+ cb_data.data = data;
|
||||
+ cb_data.D = D;
|
||||
+ cb_data.LD = LD;
|
||||
|
||||
+ draw_image(draw_image_cb, &cb_data, ix, iy, iw, ih, D);
|
||||
}
|
||||
|
||||
void Fl_PostScript_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data, int ix, int iy, int iw, int ih, int D) {
|
||||
@@ -325,6 +291,14 @@
|
||||
uchar g = curdata[1];
|
||||
uchar b = curdata[2];
|
||||
|
||||
+ if (lang_level_<3 && D>3) { //can do mixing using bg_* colors)
|
||||
+ unsigned int a2 = curdata[3]; //must be int
|
||||
+ unsigned int a = 255-a2;
|
||||
+ r = (a2 * r + bg_r * a)/255;
|
||||
+ g = (a2 * g + bg_g * a)/255;
|
||||
+ b = (a2 * b + bg_b * a)/255;
|
||||
+ }
|
||||
+
|
||||
if (!(i%40)) fputs("\n", output);
|
||||
fprintf(output, "%.2x%.2x%.2x", r, g, b);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--- unix/xserver/man/Makefile.am 2013-03-30 17:51:01.707258746 -0400
|
||||
+++ unix/xserver/man/Makefile.am 2013-03-30 17:51:47.606569692 -0400
|
||||
@@ -2,5 +2,7 @@
|
||||
# (i.e. those handled in the os/utils.c options processing instead of in
|
||||
# the DDX-level options processing)
|
||||
|
||||
+if ENABLE_DOCS
|
||||
include $(top_srcdir)/manpages.am
|
||||
appman_PRE = Xserver.man
|
||||
+endif ENABLE_DOCS
|
||||
154
contrib/packages/rpm/el6/SOURCES/vncserver.service
Normal file
154
contrib/packages/rpm/el6/SOURCES/vncserver.service
Normal file
@@ -0,0 +1,154 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# chkconfig: - 91 35
|
||||
# description: Starts and stops vncserver. \
|
||||
# used to provide remote X administration services.
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: vncserver
|
||||
# Required-Start: $network $named
|
||||
# Required-Stop: $network $named
|
||||
# Default-Start:
|
||||
# Default-Stop: 0 1 2 3 4 5 6
|
||||
# Short-Description: start|stop|restart|try-restart|status|force-reload vncserver
|
||||
# Description: control vncserver which exports your desktop
|
||||
### END INIT INFO
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
[ -r /etc/sysconfig/vncservers ] && . /etc/sysconfig/vncservers
|
||||
|
||||
prog=$"VNC server"
|
||||
|
||||
RETVAL=0
|
||||
|
||||
start() {
|
||||
[ "$EUID" != "0" ] && exit 4
|
||||
|
||||
# Source networking configuration.
|
||||
. /etc/sysconfig/network
|
||||
|
||||
# Check that networking is up.
|
||||
[ ${NETWORKING} = "no" ] && exit 1
|
||||
|
||||
[ -x /usr/bin/vncserver ] || exit 5
|
||||
[ -x /usr/bin/Xvnc ] || exit 5
|
||||
|
||||
echo -n $"Starting $prog: "
|
||||
RETVAL=0
|
||||
if [ ! -d /tmp/.X11-unix ]
|
||||
then
|
||||
mkdir -m 1777 /tmp/.X11-unix || :
|
||||
restorecon /tmp/.X11-unix 2>/dev/null || :
|
||||
fi
|
||||
|
||||
for display in ${VNCSERVERS}
|
||||
do
|
||||
SERVS=1
|
||||
echo -n "${display} "
|
||||
DISP="${display%%:*}"
|
||||
USER="${display##*:}"
|
||||
VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
|
||||
if [ -r $(eval echo ~${USER})/.vnc/passwd ]; then
|
||||
runuser -l ${USER} -c \
|
||||
"cd ~${USER} && vncserver :${DISP} ${VNCUSERARGS}"
|
||||
RETVAL=$?
|
||||
else
|
||||
echo
|
||||
echo VNC password for user ${USER} is not configured
|
||||
RETVAL=1
|
||||
fi
|
||||
[ "$RETVAL" -eq 0 ] || break
|
||||
done
|
||||
if [ -z "$SERVS" ]; then
|
||||
echo -n "no displays configured "
|
||||
failure
|
||||
RETVAL=6
|
||||
else
|
||||
if [ "$RETVAL" -eq 0 ]; then
|
||||
success $"vncserver startup"
|
||||
touch /var/lock/subsys/Xvnc
|
||||
else
|
||||
failure $"vncserver start"
|
||||
fi
|
||||
fi
|
||||
echo
|
||||
|
||||
# As written in https://bugzilla.redhat.com/show_bug.cgi?id=523974 (LSB
|
||||
# compliance) start of already running service is OK.
|
||||
[ "$RETVAL" -eq 98 ] && RETVAL=0
|
||||
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
stop() {
|
||||
[ "$EUID" != "0" ] && exit 4
|
||||
|
||||
echo -n $"Shutting down $prog: "
|
||||
|
||||
status Xvnc > /dev/null 2>&1
|
||||
RETVAL=$?
|
||||
|
||||
# 3 means service is already stopped
|
||||
if ! [ "$RETVAL" -eq 3 ]; then
|
||||
for display in ${VNCSERVERS}; do
|
||||
echo -n "${display} "
|
||||
export USER="${display##*:}"
|
||||
runuser ${USER} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
|
||||
done
|
||||
RETVAL=$?
|
||||
else
|
||||
let RETVAL=0
|
||||
fi
|
||||
|
||||
[ "$RETVAL" -eq 0 ] && success $"vncserver shutdown" || \
|
||||
failure $"vncserver shutdown"
|
||||
echo
|
||||
[ "$RETVAL" -eq 0 ] && rm -f /var/lock/subsys/Xvnc
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|force-reload)
|
||||
stop
|
||||
sleep 3
|
||||
start
|
||||
;;
|
||||
condrestart)
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=508367
|
||||
# echo "condrestart is obsolete, use try-restart instead"
|
||||
if [ -e /var/lock/subsys/Xvnc ]; then
|
||||
stop
|
||||
sleep 3
|
||||
start
|
||||
fi
|
||||
;;
|
||||
try-restart)
|
||||
if [ -e /var/lock/subsys/Xvnc ]; then
|
||||
stop
|
||||
sleep 3
|
||||
start
|
||||
fi
|
||||
;;
|
||||
status)
|
||||
status Xvnc
|
||||
RETVAL=$?
|
||||
;;
|
||||
reload)
|
||||
exit 3
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart|try-restart|status|force-reload}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit "$RETVAL"
|
||||
|
||||
19
contrib/packages/rpm/el6/SOURCES/vncserver.sysconfig
Normal file
19
contrib/packages/rpm/el6/SOURCES/vncserver.sysconfig
Normal file
@@ -0,0 +1,19 @@
|
||||
# The VNCSERVERS variable is a list of display:user pairs.
|
||||
#
|
||||
# Uncomment the lines below to start a VNC server on display :2
|
||||
# as my 'myusername' (adjust this to your own). You will also
|
||||
# need to set a VNC password; run 'man vncpasswd' to see how
|
||||
# to do that.
|
||||
#
|
||||
# DO NOT RUN THIS SERVICE if your local area network is
|
||||
# untrusted! For a secure way of using VNC, see this URL:
|
||||
# http://kbase.redhat.com/faq/docs/DOC-7028
|
||||
|
||||
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
|
||||
|
||||
# Use "-localhost" to prevent remote VNC clients connecting except when
|
||||
# doing so through a secure tunnel. See the "-via" option in the
|
||||
# `man vncviewer' manual page.
|
||||
|
||||
# VNCSERVERS="2:myusername"
|
||||
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
|
||||
844
contrib/packages/rpm/el6/SPECS/tigervnc.spec
Normal file
844
contrib/packages/rpm/el6/SPECS/tigervnc.spec
Normal file
@@ -0,0 +1,844 @@
|
||||
%{!?_self_signed: %define _self_signed 1}
|
||||
%{!?_bootstrap: %define _bootstrap 1}
|
||||
%define tigervnc_src_dir %{_builddir}/%{name}-%{version}%{?snap:-%{snap}}
|
||||
%global scl_name %{name}16
|
||||
%if %{_bootstrap}
|
||||
%define static_lib_buildroot %{tigervnc_src_dir}/opt/%{name}/%{scl_name}
|
||||
%else
|
||||
%define static_lib_buildroot /opt/%{name}/%{scl_name}
|
||||
%endif
|
||||
|
||||
Name: tigervnc
|
||||
Version: @VERSION@
|
||||
Release: 5%{?snap:.%{snap}}%{?dist}
|
||||
Summary: A TigerVNC remote display system
|
||||
|
||||
Group: User Interface/Desktops
|
||||
License: GPLv2+
|
||||
Packager: Brian P. Hinz <bphinz@users.sourceforge.net>
|
||||
URL: http://www.tigervnc.com
|
||||
|
||||
Source0: %{name}-%{version}%{?snap:-%{snap}}.tar.bz2
|
||||
Source1: vncserver.service
|
||||
Source2: vncserver.sysconfig
|
||||
Source11: http://fltk.org/pub/fltk/1.3.3/fltk-1.3.3-source.tar.gz
|
||||
Source13: http://downloads.sourceforge.net/project/libpng/libpng15/1.5.24/libpng-1.5.24.tar.bz2
|
||||
Source14: https://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.bz2
|
||||
Source15: http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.7.tar.gz
|
||||
Source16: https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz
|
||||
Source17: ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.19.tar.xz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildRequires: gcc, gcc-c++
|
||||
BuildRequires: libX11-devel, automake, autoconf, libtool, gettext, gettext-devel
|
||||
BuildRequires: libXext-devel, xorg-x11-server-source, libXi-devel
|
||||
BuildRequires: xorg-x11-xtrans-devel, xorg-x11-util-macros, libXtst-devel
|
||||
BuildRequires: libdrm-devel, libXt-devel, pixman-devel libXfont-devel
|
||||
BuildRequires: libxkbfile-devel, openssl-devel, libpciaccess-devel
|
||||
BuildRequires: mesa-libGL-devel, libXinerama-devel, ImageMagick
|
||||
BuildRequires: freetype-devel, libXdmcp-devel
|
||||
BuildRequires: java-devel, jpackage-utils
|
||||
BuildRequires: libjpeg-turbo-devel, pam-devel
|
||||
BuildRequires: cmake >= 2.8
|
||||
%if !%{_bootstrap}
|
||||
BuildRequires: %{name}-static-devel == %{version}
|
||||
%endif
|
||||
%ifnarch s390 s390x
|
||||
BuildRequires: xorg-x11-server-devel
|
||||
%endif
|
||||
|
||||
Requires(post): initscripts chkconfig coreutils
|
||||
Requires(postun): coreutils
|
||||
Requires: libjpeg-turbo
|
||||
Requires: hicolor-icon-theme
|
||||
Requires: tigervnc-license
|
||||
Requires: tigervnc-icons
|
||||
|
||||
Provides: vnc = 4.1.3-2, vnc-libs = 4.1.3-2
|
||||
Obsoletes: vnc < 4.1.3-2, vnc-libs < 4.1.3-2
|
||||
Provides: tightvnc = 1.5.0-0.15.20090204svn3586
|
||||
Obsoletes: tightvnc < 1.5.0-0.15.20090204svn3586
|
||||
|
||||
Patch16: tigervnc-xorg-manpages.patch
|
||||
Patch17: nettle-2.7.1-ecc-cve.patch
|
||||
|
||||
%description
|
||||
Virtual Network Computing (VNC) is a remote display system which
|
||||
allows you to view a computing 'desktop' environment not only on the
|
||||
machine where it is running, but from anywhere on the Internet and
|
||||
from a wide variety of machine architectures. This package contains a
|
||||
client which will allow you to connect to other desktops running a VNC
|
||||
server.
|
||||
|
||||
%package server
|
||||
Summary: A TigerVNC server
|
||||
Group: User Interface/X
|
||||
Provides: vnc-server = 4.1.3-2, vnc-libs = 4.1.3-2
|
||||
Obsoletes: vnc-server < 4.1.3-2, vnc-libs < 4.1.3-2
|
||||
Provides: tightvnc-server = 1.5.0-0.15.20090204svn3586
|
||||
Obsoletes: tightvnc-server < 1.5.0-0.15.20090204svn3586
|
||||
Requires: perl
|
||||
Requires: tigervnc-server-minimal
|
||||
Requires: xorg-x11-xauth
|
||||
|
||||
%description server
|
||||
The VNC system allows you to access the same desktop from a wide
|
||||
variety of platforms. This package includes set of utilities
|
||||
which make usage of TigerVNC server more user friendly. It also
|
||||
contains x0vncserver program which can export your active
|
||||
X session.
|
||||
|
||||
%package server-minimal
|
||||
Summary: A minimal installation of TigerVNC server
|
||||
Group: User Interface/X
|
||||
Requires(post): chkconfig
|
||||
Requires(preun):chkconfig
|
||||
Requires(preun):initscripts
|
||||
Requires(postun):initscripts
|
||||
|
||||
Requires: mesa-dri-drivers, xkeyboard-config, xorg-x11-xkb-utils
|
||||
Requires: tigervnc-license
|
||||
|
||||
%description server-minimal
|
||||
The VNC system allows you to access the same desktop from a wide
|
||||
variety of platforms. This package contains minimal installation
|
||||
of TigerVNC server, allowing others to access the desktop on your
|
||||
machine.
|
||||
|
||||
%ifnarch s390 s390x %{?rhel:ppc ppc64}
|
||||
%package server-module
|
||||
Summary: TigerVNC module to Xorg
|
||||
Group: User Interface/X
|
||||
Provides: vnc-server = 4.1.3-2, vnc-libs = 4.1.3-2
|
||||
Obsoletes: vnc-server < 4.1.3-2, vnc-libs < 4.1.3-2
|
||||
Provides: tightvnc-server-module = 1.5.0-0.15.20090204svn3586
|
||||
Obsoletes: tightvnc-server-module < 1.5.0-0.15.20090204svn3586
|
||||
Requires: xorg-x11-server-Xorg
|
||||
Requires: tigervnc-license
|
||||
|
||||
%description server-module
|
||||
This package contains libvnc.so module to X server, allowing others
|
||||
to access the desktop on your machine.
|
||||
%endif
|
||||
|
||||
%package server-applet
|
||||
Summary: Java TigerVNC viewer applet for TigerVNC server
|
||||
Group: User Interface/X
|
||||
Requires: tigervnc-server, java, jpackage-utils
|
||||
BuildArch: noarch
|
||||
|
||||
%description server-applet
|
||||
The Java TigerVNC viewer applet for web browsers. Install this package to allow
|
||||
clients to use web browser when connect to the TigerVNC server.
|
||||
|
||||
%package license
|
||||
Summary: License of TigerVNC suite
|
||||
Group: User Interface/X
|
||||
BuildArch: noarch
|
||||
|
||||
%description license
|
||||
This package contains license of the TigerVNC suite
|
||||
|
||||
%package icons
|
||||
Summary: Icons for TigerVNC viewer
|
||||
Group: User Interface/X
|
||||
BuildArch: noarch
|
||||
|
||||
%description icons
|
||||
This package contains icons for TigerVNC viewer
|
||||
|
||||
%if %{_bootstrap}
|
||||
%package static-devel
|
||||
Summary: Static development files necessary to build TigerVNC
|
||||
Group: Development/Libraries
|
||||
|
||||
%description static-devel
|
||||
This package contains static development files necessary to build TigerVNC
|
||||
%endif
|
||||
|
||||
%prep
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%setup -q -n %{name}-%{version}%{?snap:-%{snap}}
|
||||
|
||||
%if %{_bootstrap}
|
||||
tar xzf %SOURCE11
|
||||
tar xjf %SOURCE13
|
||||
tar xjf %SOURCE14
|
||||
tar xzf %SOURCE15
|
||||
tar xzf %SOURCE16
|
||||
pushd nettle-*
|
||||
%patch17 -p1 -b .ecc-cve
|
||||
popd
|
||||
xzcat %SOURCE17 | tar xf -
|
||||
%endif
|
||||
|
||||
cp -r /usr/share/xorg-x11-server-source/* unix/xserver
|
||||
pushd unix/xserver
|
||||
for all in `find . -type f -perm -001`; do
|
||||
chmod -x "$all"
|
||||
done
|
||||
patch -p1 -b --suffix .vnc < ../xserver117.patch
|
||||
popd
|
||||
|
||||
%patch16 -p0 -b .man
|
||||
|
||||
%build
|
||||
%if %{_bootstrap}
|
||||
mkdir -p %{static_lib_buildroot}%{_libdir}
|
||||
%endif
|
||||
|
||||
%ifarch sparcv9 sparc64 s390 s390x
|
||||
export CFLAGS="$RPM_OPT_FLAGS -fPIC -I%{static_lib_buildroot}%{_includedir}"
|
||||
%else
|
||||
export CFLAGS="$RPM_OPT_FLAGS -fpic -I%{static_lib_buildroot}%{_includedir}"
|
||||
%endif
|
||||
export CXXFLAGS=$CFLAGS
|
||||
export CPPFLAGS=$CXXFLAGS
|
||||
export PKG_CONFIG_PATH="%{static_lib_buildroot}%{_libdir}/pkgconfig:%{static_lib_buildroot}%{_datadir}/pkgconfig:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig"
|
||||
|
||||
%if %{_bootstrap}
|
||||
echo "*** Building gmp ***"
|
||||
pushd gmp-*
|
||||
./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --enable-cxx --disable-assembly
|
||||
make %{?_smp_mflags} DESTDIR=%{static_lib_buildroot} install
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.la" -delete
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{static_lib_buildroot}%{_libdir}|" {} \;
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{static_lib_buildroot}%{_prefix}|" {} \;
|
||||
popd
|
||||
|
||||
echo "*** Building libtasn1 ***"
|
||||
pushd libtasn1-*
|
||||
LDFLAGS="-L%{static_lib_buildroot}%{_libdir} $LDFLAGS" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --host=%{_host} --build=%{_build}
|
||||
make %{?_smp_mflags} DESTDIR=%{static_lib_buildroot} install
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.la" -delete
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{static_lib_buildroot}%{_libdir}|" {} \;
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{static_lib_buildroot}%{_prefix}|" {} \;
|
||||
popd
|
||||
|
||||
echo "*** Building nettle ***"
|
||||
pushd nettle-*
|
||||
autoreconf -fiv
|
||||
LDFLAGS="-L%{static_lib_buildroot}%{_libdir} -Wl,-Bstatic -ltasn1 -lgmp -Wl,-Bdynamic $LDFLAGS" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --disable-openssl --host=%{_host} --build=%{_build}
|
||||
make %{?_smp_mflags} DESTDIR=%{static_lib_buildroot} install
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.la" -delete
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{static_lib_buildroot}%{_libdir}|" {} \;
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{static_lib_buildroot}%{_prefix}|" {} \;
|
||||
popd
|
||||
|
||||
echo "*** Building gnutls ***"
|
||||
pushd gnutls-*
|
||||
LDFLAGS="-L%{static_lib_buildroot}%{_libdir} -Wl,-Bstatic -lnettle -lhogweed -ltasn1 -lgmp -Wl,-Bdynamic $LDFLAGS" ./configure \
|
||||
--prefix=%{_prefix} \
|
||||
--libdir=%{_libdir} \
|
||||
--host=%{_host} \
|
||||
--build=%{_build} \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--without-p11-kit \
|
||||
--disable-guile \
|
||||
--disable-srp-authentication \
|
||||
--disable-libdane \
|
||||
--disable-doc \
|
||||
--enable-local-libopts \
|
||||
--without-tpm \
|
||||
--disable-dependency-tracking \
|
||||
--disable-silent-rules \
|
||||
--disable-heartbeat-support
|
||||
make %{?_smp_mflags} DESTDIR=%{static_lib_buildroot} install
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.la" -delete
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{static_lib_buildroot}%{_libdir}|" {} \;
|
||||
find %{static_lib_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{static_lib_buildroot}%{_prefix}|" {} \;
|
||||
popd
|
||||
|
||||
echo "*** Building libpng ***"
|
||||
pushd libpng-*
|
||||
CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \
|
||||
--prefix=%{_prefix} \
|
||||
--libdir=%{_libdir} \
|
||||
--host=%{_host} \
|
||||
--build=%{_build} \
|
||||
--disable-shared \
|
||||
--enable-static
|
||||
make %{?_smp_mflags}
|
||||
make DESTDIR=%{static_lib_buildroot} install
|
||||
popd
|
||||
|
||||
echo "*** Building fltk ***"
|
||||
pushd fltk-*
|
||||
%endif
|
||||
export CMAKE_PREFIX_PATH="%{static_lib_buildroot}%{_prefix}:%{_prefix}"
|
||||
export CMAKE_EXE_LINKER_FLAGS=$LDFLAGS
|
||||
export PKG_CONFIG="pkg-config --static"
|
||||
%if %{_bootstrap}
|
||||
CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="-L%{static_lib_buildroot}%{_libdir} -Wl,-Bstatic -lpng -Wl,-Bdynamic $LDFLAGS" ./configure \
|
||||
--prefix=%{_prefix} \
|
||||
--libdir=%{_libdir} \
|
||||
--host=%{_host} \
|
||||
--build=%{_build} \
|
||||
--enable-x11 \
|
||||
--enable-gl \
|
||||
--disable-shared \
|
||||
--enable-localjpeg \
|
||||
--enable-localzlib \
|
||||
--disable-localpng \
|
||||
--enable-xinerama \
|
||||
--enable-xft \
|
||||
--enable-xdbe \
|
||||
--enable-xfixes \
|
||||
--enable-xcursor \
|
||||
--with-x
|
||||
make %{?_smp_mflags}
|
||||
make DESTDIR=%{static_lib_buildroot} install
|
||||
popd
|
||||
%endif
|
||||
|
||||
%{cmake} -G"Unix Makefiles" \
|
||||
-DBUILD_STATIC=off \
|
||||
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
|
||||
-DFLTK_LIBRARIES="%{static_lib_buildroot}%{_libdir}/libfltk.a;%{static_lib_buildroot}%{_libdir}/libfltk_images.a;%{static_lib_buildroot}%{_libdir}/libpng.a" \
|
||||
-DFLTK_INCLUDE_DIR=%{static_lib_buildroot}%{_includedir} \
|
||||
-DGNUTLS_INCLUDE_DIR=%{static_lib_buildroot}%{_includedir} \
|
||||
-DGNUTLS_LIBRARY="%{static_lib_buildroot}%{_libdir}/libgnutls.a;%{static_lib_buildroot}%{_libdir}/libtasn1.a;%{static_lib_buildroot}%{_libdir}/libnettle.a;%{static_lib_buildroot}%{_libdir}/libhogweed.a;%{static_lib_buildroot}%{_libdir}/libgmp.a"
|
||||
make %{?_smp_mflags}
|
||||
|
||||
pushd unix/xserver
|
||||
autoreconf -fiv
|
||||
%configure \
|
||||
--disable-xorg --disable-xnest --disable-xvfb --disable-dmx \
|
||||
--disable-xwin --disable-xephyr --disable-kdrive --disable-wayland \
|
||||
--with-pic --disable-static --enable-xinerama \
|
||||
--with-default-font-path="catalogue:%{_sysconfdir}/X11/fontpath.d,built-ins" \
|
||||
--with-serverconfig-path=%{_libdir}/xorg \
|
||||
--with-fontrootdir=%{_datadir}/X11/fonts \
|
||||
--with-xkb-output=%{_localstatedir}/lib/xkb \
|
||||
--enable-install-libxf86config \
|
||||
--enable-glx --enable-glx-tls --disable-dri --enable-dri2 --disable-dri3 \
|
||||
--disable-config-dbus \
|
||||
--disable-config-hal \
|
||||
--disable-config-udev \
|
||||
--without-dtrace \
|
||||
--disable-unit-tests \
|
||||
--disable-docs \
|
||||
--disable-devel-docs \
|
||||
--disable-selective-werror
|
||||
|
||||
make %{?_smp_mflags}
|
||||
popd
|
||||
|
||||
# Build icons
|
||||
pushd media
|
||||
make
|
||||
popd
|
||||
|
||||
# Build Java applet
|
||||
pushd java
|
||||
%{cmake} \
|
||||
%if !%{_self_signed}
|
||||
-DJAVA_KEYSTORE=%{_keystore} \
|
||||
-DJAVA_KEYSTORE_TYPE=%{_keystore_type} \
|
||||
-DJAVA_KEY_ALIAS=%{_key_alias} \
|
||||
-DJAVA_STOREPASS=":env STOREPASS" \
|
||||
-DJAVA_KEYPASS=":env KEYPASS" \
|
||||
-DJAVA_TSA_URL=http://timestamp.geotrust.com/tsa .
|
||||
%endif
|
||||
|
||||
make
|
||||
popd
|
||||
|
||||
%install
|
||||
%if %{_bootstrap}
|
||||
for l in gmp libtasn1 nettle gnutls libpng fltk; do
|
||||
pushd $l-*
|
||||
make install DESTDIR=$RPM_BUILD_ROOT/opt/%{name}/%{scl_name}
|
||||
popd
|
||||
done
|
||||
find %{buildroot}/opt/%{name}/%{scl_name}%{_prefix} -type f -name "*.la" -delete
|
||||
find %{buildroot}/opt/%{name}/%{scl_name}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=/opt/%{name}/%{scl_name}%{_libdir}|" {} \;
|
||||
find %{buildroot}/opt/%{name}/%{scl_name}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=/opt/%{name}/%{scl_name}%{_prefix}|" {} \;
|
||||
%endif
|
||||
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
pushd unix/xserver/hw/vnc
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
popd
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
|
||||
install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/vncserver
|
||||
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/vncservers
|
||||
|
||||
# Install Java applet
|
||||
pushd java
|
||||
mkdir -p $RPM_BUILD_ROOT%{_datadir}/vnc/classes
|
||||
install -m755 VncViewer.jar $RPM_BUILD_ROOT%{_datadir}/vnc/classes
|
||||
install -m644 com/tigervnc/vncviewer/index.vnc $RPM_BUILD_ROOT%{_datadir}/vnc/classes
|
||||
popd
|
||||
|
||||
%find_lang %{name} %{name}.lang
|
||||
|
||||
# remove unwanted files
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions/libvnc.la
|
||||
|
||||
%ifarch s390 s390x %{?rhel:ppc ppc64}
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/xorg/modules/extensions/libvnc.so
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post
|
||||
touch -c %{_datadir}/icons/hicolor
|
||||
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
|
||||
%{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor || :
|
||||
fi
|
||||
|
||||
%postun
|
||||
touch -c %{_datadir}/icons/hicolor
|
||||
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
|
||||
%{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor || :
|
||||
fi
|
||||
|
||||
%post server
|
||||
/sbin/chkconfig --add vncserver
|
||||
|
||||
%triggerun -- tigervnc-server < 1.0.90-6
|
||||
/sbin/service vncserver stop &>/dev/null || :
|
||||
/sbin/chkconfig --del vncserver >/dev/null 2>&1 || :
|
||||
|
||||
%files -f %{name}.lang
|
||||
%defattr(-,root,root,-)
|
||||
%doc README.md
|
||||
%{_bindir}/vncviewer
|
||||
%{_datadir}/applications/*
|
||||
%{_mandir}/man1/vncviewer.1*
|
||||
|
||||
%files server
|
||||
%defattr(-,root,root,-)
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/vncservers
|
||||
%config(noreplace) %{_sysconfdir}/init.d/vncserver
|
||||
%{_bindir}/x0vncserver
|
||||
%{_bindir}/vncserver
|
||||
%{_mandir}/man1/vncserver.1*
|
||||
%{_mandir}/man1/x0vncserver.1*
|
||||
|
||||
%files server-minimal
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/vncconfig
|
||||
%{_bindir}/vncpasswd
|
||||
%{_bindir}/Xvnc
|
||||
%{_mandir}/man1/Xvnc.1*
|
||||
%{_mandir}/man1/vncpasswd.1*
|
||||
%{_mandir}/man1/vncconfig.1*
|
||||
|
||||
%ifnarch s390 s390x %{?rhel:ppc ppc64}
|
||||
%files server-module
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/xorg/modules/extensions/libvnc.so
|
||||
%endif
|
||||
|
||||
%files server-applet
|
||||
%defattr(-,root,root,-)
|
||||
%doc java/com/tigervnc/vncviewer/README
|
||||
%{_datadir}/vnc/classes/*
|
||||
|
||||
%files license
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENCE.TXT
|
||||
|
||||
%files icons
|
||||
%defattr(-,root,root,-)
|
||||
%{_datadir}/icons/hicolor/*/apps/*
|
||||
|
||||
%if %{_bootstrap}
|
||||
%files static-devel
|
||||
%defattr(-,root,root,-)
|
||||
/opt/%{name}/%{scl_name}%{_bindir}/*
|
||||
/opt/%{name}/%{scl_name}%{_includedir}/*
|
||||
/opt/%{name}/%{scl_name}%{_libdir}/*
|
||||
/opt/%{name}/%{scl_name}%{_datadir}/*
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Jun 20 2016 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-5
|
||||
- Patch for Xorg 1.17 due to vendor bump of Xorg version
|
||||
|
||||
* Sat Apr 02 2016 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-4
|
||||
- Fixed CVE-2015-8803 CVE-2015-8804 CVE-2015-8805 secp256r1 and secp384r1 bugs
|
||||
|
||||
* Fri Dec 11 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-3
|
||||
- Configure with --host and --build to avoid build host-specific compiler opts
|
||||
|
||||
* Sun Nov 29 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-2
|
||||
- Split static pre-reqs into separate package
|
||||
|
||||
* Thu Nov 26 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-1
|
||||
- Version bump for 1.6 release
|
||||
- Update gnutls, libtasn1, libpng to latest upstream versions.
|
||||
|
||||
* Sat Mar 14 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-21
|
||||
- Build static libraries to meet new minimum requirements
|
||||
|
||||
* Sat Mar 07 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-20
|
||||
- Don't disable xinerama extension
|
||||
|
||||
* Thu Feb 19 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-19
|
||||
- Bumped fltk version to 1.3.3, no longer requires any patching
|
||||
|
||||
* Tue Nov 04 2014 Brian P. Hinz <bphinz@users.sourceforge.net> 1.3.80-18.20131128svn5139
|
||||
- Bumped xserver patch to keep pace with native version
|
||||
|
||||
* Thu Nov 28 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.3.80-17.20131128svn5139
|
||||
- Bumped version to 1.3.80
|
||||
- Cleaned up linter warnings
|
||||
|
||||
* Thu Jul 05 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.3.0
|
||||
- Upstream 1.3.0 release
|
||||
- Conditional-ized %snap for release
|
||||
|
||||
* Thu Apr 04 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.90-12.20130524svn5114
|
||||
- Improve spec file portability
|
||||
|
||||
* Thu Apr 04 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.80-12.20130330svn5066
|
||||
- Adapted from fedora for el6
|
||||
|
||||
* Thu Mar 14 2013 Adam Tkac <atkac redhat com> - 1.2.80-0.10.20130314svn5065
|
||||
- include /etc/X11/xorg.conf.d/10-libvnc.conf sample configuration (#712482)
|
||||
- vncserver now honors specified -geometry parameter (#755947)
|
||||
|
||||
* Tue Mar 12 2013 Adam Tkac <atkac redhat com> - 1.2.80-0.9.20130307svn5060
|
||||
- update to r5060
|
||||
- split icons to separate package to avoid multilib issues
|
||||
|
||||
* Thu Jan 24 2013 Adam Tkac <atkac redhat com> 1.2.80-0.8.20130124svn5036
|
||||
- update to r5036 (#892351)
|
||||
|
||||
* Wed Jan 16 2013 Adam Tkac <atkac redhat com> 1.2.80-0.7.20121126svn5015
|
||||
- rebuild
|
||||
|
||||
* Tue Dec 04 2012 Adam Tkac <atkac redhat com> 1.2.80-0.6.20121126svn5015
|
||||
- rebuild against new fltk
|
||||
|
||||
* Mon Nov 26 2012 Adam Tkac <atkac redhat com> 1.2.80-0.5.20121126svn5015
|
||||
- update to r5015
|
||||
- build with -fpic instead of -fPIC on all archs except s390/sparc
|
||||
|
||||
* Wed Nov 7 2012 Peter Robinson <pbrobinson@fedoraproject.org> 1.2.80-0.4.20120905svn4996
|
||||
- Build with -fPIC to fix FTBFS on ARM
|
||||
|
||||
* Wed Oct 31 2012 Adam Jackson <ajax@redhat.com> 1.2.80-0.3.20120905svn4996
|
||||
- tigervnc12-xorg113-glx.patch: Fix to only init glx on the first server
|
||||
generation
|
||||
|
||||
* Fri Sep 28 2012 Adam Jackson <ajax@redhat.com> 1.2.80-0.2.20120905svn4996
|
||||
- tigervnc12-xorg113-glx.patch: Re-enable GLX against xserver 1.13
|
||||
|
||||
* Fri Aug 17 2012 Adam Tkac <atkac redhat com> 1.2.80-0.1.20120905svn4996
|
||||
- update to 1.2.80
|
||||
- remove deprecated patches
|
||||
- tigervnc-102434.patch
|
||||
- tigervnc-viewer-reparent.patch
|
||||
- tigervnc11-java7.patch
|
||||
- patches merged
|
||||
- tigervnc11-xorg111.patch
|
||||
- tigervnc11-xorg112.patch
|
||||
|
||||
* Fri Aug 10 2012 Dave Airlie <airlied@redhat.com> 1.1.0-10
|
||||
- fix build against newer X server
|
||||
|
||||
* Mon Jul 23 2012 Adam Jackson <ajax@redhat.com> 1.1.0-9
|
||||
- Build with the Composite extension for feature parity with other X servers
|
||||
|
||||
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Thu Jul 19 2012 Dave Airlie <airlied@redhat.com> 1.1.0-7
|
||||
- fix building against X.org 1.13
|
||||
|
||||
* Wed Apr 04 2012 Adam Jackson <ajax@redhat.com> 1.1.0-6
|
||||
- RHEL exclusion for -server-module on ppc* too
|
||||
|
||||
* Mon Mar 26 2012 Adam Tkac <atkac redhat com> - 1.1.0-5
|
||||
- clean Xvnc's /tmp environment in service file before startup
|
||||
- fix building against the latest JAVA 7 and X.Org 1.12
|
||||
|
||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Tue Nov 22 2011 Adam Tkac <atkac redhat com> - 1.1.0-3
|
||||
- don't build X.Org devel docs (#755782)
|
||||
- applet: BR generic java-devel instead of java-gcj-devel (#755783)
|
||||
- use runuser to start Xvnc in systemd service file (#754259)
|
||||
- don't attepmt to restart Xvnc session during update/erase (#753216)
|
||||
|
||||
* Fri Nov 11 2011 Adam Tkac <atkac redhat com> - 1.1.0-2
|
||||
- libvnc.so: don't use unexported GetMaster function (#744881)
|
||||
- remove nasm buildreq
|
||||
|
||||
* Mon Sep 12 2011 Adam Tkac <atkac redhat com> - 1.1.0-1
|
||||
- update to 1.1.0
|
||||
- update the xorg11 patch
|
||||
- patches merged
|
||||
- tigervnc11-glx.patch
|
||||
- tigervnc11-CVE-2011-1775.patch
|
||||
- 0001-Use-memmove-instead-of-memcpy-in-fbblt.c-when-memory.patch
|
||||
|
||||
* Thu Jul 28 2011 Adam Tkac <atkac redhat com> - 1.0.90-6
|
||||
- add systemd service file and remove legacy SysV initscript (#717227)
|
||||
|
||||
* Tue May 12 2011 Adam Tkac <atkac redhat com> - 1.0.90-5
|
||||
- make Xvnc buildable against X.Org 1.11
|
||||
|
||||
* Tue May 10 2011 Adam Tkac <atkac redhat com> - 1.0.90-4
|
||||
- viewer can send password without proper validation of X.509 certs
|
||||
(CVE-2011-1775)
|
||||
|
||||
* Wed Apr 13 2011 Adam Tkac <atkac redhat com> - 1.0.90-3
|
||||
- fix wrong usage of memcpy which caused screen artifacts (#652590)
|
||||
- don't point to inaccessible link in sysconfig/vncservers (#644975)
|
||||
|
||||
* Fri Apr 08 2011 Adam Tkac <atkac redhat com> - 1.0.90-2
|
||||
- improve compatibility with vinagre client (#692048)
|
||||
|
||||
* Tue Mar 22 2011 Adam Tkac <atkac redhat com> - 1.0.90-1
|
||||
- update to 1.0.90
|
||||
|
||||
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.90-0.32.20110117svn4237
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Mon Jan 17 2011 Adam Tkac <atkac redhat com> 1.0.90-0.31.20110117svn4237
|
||||
- fix libvnc.so module loading
|
||||
|
||||
* Mon Jan 17 2011 Adam Tkac <atkac redhat com> 1.0.90-0.30.20110117svn4237
|
||||
- update to r4237
|
||||
- patches merged
|
||||
- tigervnc11-optionsdialog.patch
|
||||
- tigervnc11-rh607866.patch
|
||||
|
||||
* Fri Jan 14 2011 Adam Tkac <atkac redhat com> 1.0.90-0.29.20101208svn4225
|
||||
- improve patch for keyboard issues
|
||||
|
||||
* Fri Jan 14 2011 Adam Tkac <atkac redhat com> 1.0.90-0.28.20101208svn4225
|
||||
- attempt to fix various keyboard-related issues (key repeating etc)
|
||||
|
||||
* Fri Jan 07 2011 Adam Tkac <atkac redhat com> 1.0.90-0.27.20101208svn4225
|
||||
- render "Ok" and "Cancel" buttons in the options dialog correctly
|
||||
|
||||
* Wed Dec 15 2010 Jan Görig <jgorig redhat com> 1.0.90-0.26.20101208svn4225
|
||||
- added vncserver lock file (#662784)
|
||||
|
||||
* Fri Dec 10 2010 Adam Tkac <atkac redhat com> 1.0.90-0.25.20101208svn4225
|
||||
- update to r4225
|
||||
- patches merged
|
||||
- tigervnc11-rh611677.patch
|
||||
- tigervnc11-rh633931.patch
|
||||
- tigervnc11-xorg1.10.patch
|
||||
- enable VeNCrypt and PAM support
|
||||
|
||||
* Mon Dec 06 2010 Adam Tkac <atkac redhat com> 1.0.90-0.24.20100813svn4123
|
||||
- rebuild against xserver 1.10.X
|
||||
- 0001-Return-Success-from-generate_modkeymap-when-max_keys.patch merged
|
||||
|
||||
* Wed Sep 29 2010 jkeating - 1.0.90-0.23.20100813svn4123
|
||||
- Rebuilt for gcc bug 634757
|
||||
|
||||
* Tue Sep 21 2010 Adam Tkac <atkac redhat com> 1.0.90-0.22.20100420svn4030
|
||||
- drop xorg-x11-fonts-misc dependency (#636170)
|
||||
|
||||
* Tue Sep 21 2010 Adam Tkac <atkac redhat com> 1.0.90-0.21.20100420svn4030
|
||||
- improve patch for #633645 (fix tcsh incompatibilities)
|
||||
|
||||
* Thu Sep 16 2010 Adam Tkac <atkac redhat com> 1.0.90-0.20.20100813svn4123
|
||||
- press fake modifiers correctly (#633931)
|
||||
- supress unneeded debug information emitted from initscript (#633645)
|
||||
|
||||
* Wed Aug 25 2010 Adam Tkac <atkac redhat com> 1.0.90-0.19.20100813svn4123
|
||||
- separate Xvnc, vncpasswd and vncconfig to -server-minimal subpkg (#626946)
|
||||
- move license to separate subpkg and Requires it from main subpkgs
|
||||
- Xvnc: handle situations when no modifiers exist well (#611677)
|
||||
|
||||
* Fri Aug 13 2010 Adam Tkac <atkac redhat com> 1.0.90-0.18.20100813svn4123
|
||||
- update to r4123 (#617973)
|
||||
- add perl requires to -server subpkg (#619791)
|
||||
|
||||
* Thu Jul 22 2010 Adam Tkac <atkac redhat com> 1.0.90-0.17.20100721svn4113
|
||||
- update to r4113
|
||||
- patches merged
|
||||
- tigervnc11-rh586406.patch
|
||||
- tigervnc11-libvnc.patch
|
||||
- tigervnc11-rh597172.patch
|
||||
- tigervnc11-rh600070.patch
|
||||
- tigervnc11-options.patch
|
||||
- don't own %%{_datadir}/icons directory (#614301)
|
||||
- minor improvements in the .desktop file (#616340)
|
||||
- bundled libjpeg configure requires nasm; is executed even if system-wide
|
||||
libjpeg is used
|
||||
|
||||
* Fri Jul 02 2010 Adam Tkac <atkac redhat com> 1.0.90-0.16.20100420svn4030
|
||||
- build against system-wide libjpeg-turbo (#494458)
|
||||
- build no longer requires nasm
|
||||
|
||||
* Mon Jun 28 2010 Adam Tkac <atkac redhat com> 1.0.90-0.15.20100420svn4030
|
||||
- vncserver: accept <+optname> option when specified as the first one
|
||||
|
||||
* Thu Jun 24 2010 Adam Tkac <atkac redhat com> 1.0.90-0.14.20100420svn4030
|
||||
- fix memory leak in Xvnc input code (#597172)
|
||||
- don't crash when receive negative encoding (#600070)
|
||||
- explicitly disable udev configuration support
|
||||
- add gettext-autopoint to BR
|
||||
|
||||
* Mon Jun 14 2010 Adam Tkac <atkac redhat com> 1.0.90-0.13.20100420svn4030
|
||||
- update URL about SSH tunneling in the sysconfig file (#601996)
|
||||
|
||||
* Fri Jun 11 2010 Adam Tkac <atkac redhat com> 1.0.90-0.12.20100420svn4030
|
||||
- use newer gettext
|
||||
- autopoint now uses git instead of cvs, adjust BuildRequires appropriately
|
||||
|
||||
* Thu May 13 2010 Adam Tkac <atkac redhat com> 1.0.90-0.11.20100420svn4030
|
||||
- link libvnc.so "now" to catch "undefined symbol" errors during Xorg startup
|
||||
- use always XkbConvertCase instead of XConvertCase (#580159, #586406)
|
||||
- don't link libvnc.so against libXi.la, libdix.la and libxkb.la; use symbols
|
||||
from Xorg instead
|
||||
|
||||
* Thu May 13 2010 Adam Tkac <atkac redhat com> 1.0.90-0.10.20100420svn4030
|
||||
- update to r4030 snapshot
|
||||
- patches merged to upstream
|
||||
- tigervnc11-rh522369.patch
|
||||
- tigervnc11-rh551262.patch
|
||||
- tigervnc11-r4002.patch
|
||||
- tigervnc11-r4014.patch
|
||||
|
||||
* Thu Apr 08 2010 Adam Tkac <atkac redhat com> 1.0.90-0.9.20100219svn3993
|
||||
- add server-applet subpackage which contains Java vncviewer applet
|
||||
- fix Java applet; it didn't work when run from web browser
|
||||
- add xorg-x11-xkb-utils to server Requires
|
||||
|
||||
* Fri Mar 12 2010 Adam Tkac <atkac redhat com> 1.0.90-0.8.20100219svn3993
|
||||
- add French translation to vncviewer.desktop (thanks to Alain Portal)
|
||||
|
||||
* Thu Mar 04 2010 Adam Tkac <atkac redhat com> 1.0.90-0.7.20100219svn3993
|
||||
- don't crash during pixel format change (#522369, #551262)
|
||||
|
||||
* Mon Mar 01 2010 Adam Tkac <atkac redhat com> 1.0.90-0.6.20100219svn3993
|
||||
- add mesa-dri-drivers and xkeyboard-config to -server Requires
|
||||
- update to r3993 1.0.90 snapshot
|
||||
- tigervnc11-noexecstack.patch merged
|
||||
- tigervnc11-xorg18.patch merged
|
||||
- xserver18.patch is no longer needed
|
||||
|
||||
* Wed Jan 27 2010 Jan Gorig <jgorig redhat com> 1.0.90-0.5.20091221svn3929
|
||||
- initscript LSB compliance fixes (#523974)
|
||||
|
||||
* Fri Jan 22 2010 Adam Tkac <atkac redhat com> 1.0.90-0.4.20091221svn3929
|
||||
- mark stack as non-executable in jpeg ASM code
|
||||
- add xorg-x11-xauth to Requires
|
||||
- add support for X.Org 1.8
|
||||
- drop shave sources, they are no longer needed
|
||||
|
||||
* Thu Jan 21 2010 Adam Tkac <atkac redhat com> 1.0.90-0.3.20091221svn3929
|
||||
- drop tigervnc-xorg25909.patch, it has been merged to X.Org upstream
|
||||
|
||||
* Thu Jan 07 2010 Adam Tkac <atkac redhat com> 1.0.90-0.2.20091221svn3929
|
||||
- add patch for upstream X.Org issue #25909
|
||||
- add libXdmcp-devel to build requires to build Xvnc with XDMCP support (#552322)
|
||||
|
||||
* Mon Dec 21 2009 Adam Tkac <atkac redhat com> 1.0.90-0.1.20091221svn3929
|
||||
- update to 1.0.90 snapshot
|
||||
- patches merged
|
||||
- tigervnc10-compat.patch
|
||||
- tigervnc10-rh510185.patch
|
||||
- tigervnc10-rh524340.patch
|
||||
- tigervnc10-rh516274.patch
|
||||
|
||||
* Mon Oct 26 2009 Adam Tkac <atkac redhat com> 1.0.0-3
|
||||
- create Xvnc keyboard mapping before first keypress (#516274)
|
||||
|
||||
* Thu Oct 08 2009 Adam Tkac <atkac redhat com> 1.0.0-2
|
||||
- update underlying X source to 1.6.4-0.3.fc11
|
||||
- remove bogus '-nohttpd' parameter from /etc/sysconfig/vncservers (#525629)
|
||||
- initscript LSB compliance fixes (#523974)
|
||||
- improve -LowColorSwitch documentation and handling (#510185)
|
||||
- honor dotWhenNoCursor option (and it's changes) every time (#524340)
|
||||
|
||||
* Fri Aug 28 2009 Adam Tkac <atkac redhat com> 1.0.0-1
|
||||
- update to 1.0.0
|
||||
- tigervnc10-rh495457.patch merged to upstream
|
||||
|
||||
* Mon Aug 24 2009 Karsten Hopp <karsten@redhat.com> 0.0.91-0.17
|
||||
- fix ifnarch s390x for server-module
|
||||
|
||||
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.0.91-0.16
|
||||
- rebuilt with new openssl
|
||||
|
||||
* Tue Aug 04 2009 Adam Tkac <atkac redhat com> 0.0.91-0.15
|
||||
- make Xvnc compilable
|
||||
|
||||
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.91-0.14.1
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
* Mon Jul 13 2009 Adam Tkac <atkac redhat com> 0.0.91-0.13.1
|
||||
- don't write warning when initscript is called with condrestart param (#508367)
|
||||
|
||||
* Tue Jun 23 2009 Adam Tkac <atkac redhat com> 0.0.91-0.13
|
||||
- temporary use F11 Xserver base to make Xvnc compilable
|
||||
- BuildRequires: libXi-devel
|
||||
- don't ship tigervnc-server-module on s390/s390x
|
||||
|
||||
* Mon Jun 22 2009 Adam Tkac <atkac redhat com> 0.0.91-0.12
|
||||
- fix local rendering of cursor (#495457)
|
||||
|
||||
* Thu Jun 18 2009 Adam Tkac <atkac redhat com> 0.0.91-0.11
|
||||
- update to 0.0.91 (1.0.0 RC1)
|
||||
- patches merged
|
||||
- tigervnc10-rh499401.patch
|
||||
- tigervnc10-rh497592.patch
|
||||
- tigervnc10-rh501832.patch
|
||||
- after discusion in upstream drop tigervnc-bounds.patch
|
||||
- configure flags cleanup
|
||||
|
||||
* Thu May 21 2009 Adam Tkac <atkac redhat com> 0.0.90-0.10
|
||||
- rebuild against 1.6.1.901 X server (#497835)
|
||||
- disable i18n, vncviewer is not UTF-8 compatible (#501832)
|
||||
|
||||
* Mon May 18 2009 Adam Tkac <atkac redhat com> 0.0.90-0.9
|
||||
- fix vncpasswd crash on long passwords (#499401)
|
||||
- start session dbus daemon correctly (#497592)
|
||||
|
||||
* Mon May 11 2009 Adam Tkac <atkac redhat com> 0.0.90-0.8.1
|
||||
- remove merged tigervnc-manminor.patch
|
||||
|
||||
* Tue May 05 2009 Adam Tkac <atkac redhat com> 0.0.90-0.8
|
||||
- update to 0.0.90
|
||||
|
||||
* Thu Apr 30 2009 Adam Tkac <atkac redhat com> 0.0.90-0.7.20090427svn3789
|
||||
- server package now requires xorg-x11-fonts-misc (#498184)
|
||||
|
||||
* Mon Apr 27 2009 Adam Tkac <atkac redhat com> 0.0.90-0.6.20090427svn3789
|
||||
- update to r3789
|
||||
- tigervnc-rh494801.patch merged
|
||||
- tigervnc-newfbsize.patch is no longer needed
|
||||
- fix problems when vncviewer and Xvnc run on different endianess (#496653)
|
||||
- UltraVNC and TightVNC clients work fine again (#496786)
|
||||
|
||||
* Wed Apr 08 2009 Adam Tkac <atkac redhat com> 0.0.90-0.5.20090403svn3751
|
||||
- workaround broken fontpath handling in vncserver script (#494801)
|
||||
|
||||
* Fri Apr 03 2009 Adam Tkac <atkac redhat com> 0.0.90-0.4.20090403svn3751
|
||||
- update to r3751
|
||||
- patches merged
|
||||
- tigervnc-xclients.patch
|
||||
- tigervnc-clipboard.patch
|
||||
- tigervnc-rh212985.patch
|
||||
- basic RandR support in Xvnc (resize of the desktop)
|
||||
- use built-in libjpeg (SSE2/MMX accelerated encoding on x86 platform)
|
||||
- use Tight encoding by default
|
||||
- use TigerVNC icons
|
||||
|
||||
* Tue Mar 03 2009 Adam Tkac <atkac redhat com> 0.0.90-0.3.20090303svn3631
|
||||
- update to r3631
|
||||
|
||||
* Tue Mar 03 2009 Adam Tkac <atkac redhat com> 0.0.90-0.2.20090302svn3621
|
||||
- package review related fixes
|
||||
|
||||
* Mon Mar 02 2009 Adam Tkac <atkac redhat com> 0.0.90-0.1.20090302svn3621
|
||||
- initial package, r3621
|
||||
Reference in New Issue
Block a user