Skip to content

Commit 0e9f6b6

Browse files
authored
Get rid of hacky x11 app window icon code
I had added code in 2021 or so to add the proper SpiritVNC icon to the app window, but it was hacky, x11-centric and created a lot of complexity that I can do without. It's gone now and so is the complexity. :-)
1 parent 8efec7d commit 0e9f6b6

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

src/app.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ class AppVars
134134
createdObjects(0),
135135
msgThread(0),
136136
strF12ClipVar(""),
137-
windowIcon(NULL),
138137
sshCommand("ssh")
139138
{
140139
// get user's login name for reading/writing config file
@@ -232,7 +231,6 @@ class AppVars
232231
int createdObjects;
233232
pthread_t msgThread;
234233
std::string strF12ClipVar;
235-
Fl_Image * windowIcon;
236234
std::string sshCommand;
237235
} extern * app;
238236

src/spiritvnc.cxx

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
* OF THE POSSIBILITY OF SUCH DAMAGE.
4343
*/
4444

45-
#ifndef __APPLE__
46-
#include <X11/xpm.h>
47-
#endif
4845
#include <FL/Fl.H>
4946
#include <FL/Fl_Double_Window.H>
5047
#include <FL/Fl_PNG_Image.H>
@@ -86,34 +83,9 @@ int main (int argc, char **argv)
8683
// manually trigger misc events callback
8784
svPositionWidgets();
8885

89-
// set window's icon on Linux and FreeBSD
90-
#ifndef __APPLE__
91-
// needed if display has not been previously opened
92-
fl_open_display();
93-
94-
Pixmap pm;
95-
Pixmap mask;
96-
XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display),
97-
(char **)pmSpiritvnc_xpm, &pm, &mask, NULL);
98-
99-
app->mainWin->icon(reinterpret_cast<void *>(pm));
100-
#endif
101-
10286
app->mainWin->end();
10387
app->mainWin->show(argc, argv);
10488

105-
// read in the current window hints, then modify them to allow icon transparency
106-
// Thanks Ian MacArthur!
107-
#ifndef __APPLE__
108-
XWMHints * hints = XGetWMHints(fl_display, fl_xid(app->mainWin));
109-
// ensure transparency mask is enabled for the XPM icon
110-
hints->flags |= IconMaskHint;
111-
// set the transparency mask
112-
hints->icon_mask = mask;
113-
XSetWMHints(fl_display, fl_xid(app->mainWin), hints);
114-
XFree(hints);
115-
#endif
116-
11789
Fl::focus(app->hostList);
11890
app->hostList->take_focus();
11991

0 commit comments

Comments
 (0)