How To Skip Taskbar

41 views
Skip to first unread message

Nimday Satria

unread,
Jul 20, 2017, 6:07:50 PM7/20/17
to fltk.general
Hello,

Is there any better way to skip taskbar,pager and so on without creating a dummy window first for Linux?

This is my code so far:

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_File_Chooser.H>
#include <FL/x.H>
//#include <X11/cursorfont.h>

void exit_cb(Fl_Widget*w, void*d) {
   
((Fl_Window *)d)->hide();
}

int main(int argc, char *argv[]) {
   fl_open_display
();
   
   
Window w = XCreateSimpleWindow(fl_display,RootWindow(fl_display,fl_screen),0,0,20,20,1,0,0);
   
   
Atom wt = XInternAtom(fl_display,"_NET_WM_WINDOW_TYPE",true);
   
long val = XInternAtom(fl_display,"_NET_WM_WINDOW_TYPE_DOCK",true);
   
XChangeProperty(fl_display,w,wt,XA_ATOM,32,PropModeReplace,(unsigned char*)&val,1);
   
   
Fl_Window win(0,0,300,750);
   
Fl_Button btn(20,20,60,30,"Exit");
   btn
.callback(exit_cb,&win);
   win
.border(0);
   win
.show();
   
XReparentWindow(fl_display,fl_xid(&win),w,0,0);
   win
.show();
   
return Fl::run();
}

Thanks, And sorry for my English.

Albrecht Schlosser

unread,
Jul 20, 2017, 7:17:59 PM7/20/17
to fltkg...@googlegroups.com
On 21.07.2017 00:07 Nimday Satria wrote:

> Is there any better way to skip taskbar,pager and so on without creating
> a dummy window first for Linux?

What do you mean with "skip taskbar,pager and so on"? Do you want to
create a full-screen window?

> This is my code so far:
>
> ...
> Window w = XCreateSimpleWindow(fl_display,RootWindow(fl_display,fl_screen),0,0,20,20,1,0,0);
>
> Atom wt = XInternAtom(fl_display,"_NET_WM_WINDOW_TYPE",true);
> long val = XInternAtom(fl_display,"_NET_WM_WINDOW_TYPE_DOCK",true);
> XChangeProperty(fl_display,w,wt,XA_ATOM,32,PropModeReplace,(unsignedchar*)&val,1);
> ...
> XReparentWindow(fl_display,fl_xid(&win),w,0,0);

Unfortunately I don't understand the X11 code you presented, but I
_think_ that you want to open a full-screen window. If this is true you
can use the FLTK method Fl_Window::fullscreen(), see docs at:
<http://www.fltk.org/doc-1.3/classFl__Window.html#ac3f59c5dfbf15d4ae5485c5a8c73b0c3>

If this is not what you want to do, please try to explain what you want
to achieve (or maybe someone else can help?).

Nimday Satria

unread,
Jul 20, 2017, 7:43:23 PM7/20/17
to fltk.general
Thanks for replying.

I wanted to put this window on the bottom layer,  just like wbar.
Even without border, my window manager can see this window, and that's why i added xlib code.
I will try Fl_Window::fullscreen() and maybe post a screenshot.




Albrecht Schlosser

unread,
Jul 20, 2017, 8:45:34 PM7/20/17
to fltkg...@googlegroups.com
On 21.07.2017 01:43 Nimday Satria wrote:
> Thanks for replying.

Welcome.

> I wanted to put this window on the bottom layer, just like wbar.
> Even without border, my window manager can see this window, and that's
> why i added xlib code.

Window manager may behave differently. My current WM shows windows with
border(0) in the task bar as well.

> I will try Fl_Window::fullscreen() and maybe post a screenshot.

Here is my working demo for a real fullscreen program. In this case it
doesn't matter if the window manager would show the window because the
full screen area is occluded by the window.

// fullscreen test program

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <stdio.h>

int main(int argc, char **argv) {

int sx, sy, sw, sh;
Fl::screen_xywh(sx, sy, sw, sh, 0);
printf("screen 0 = (%d, %d, %d, %d)\n", sx, sy, sw, sh);
fflush(stdout);

// sw = 600; sh = 200; // uncomment this to test with smaller size

Fl_Window *window = new Fl_Window(sx, sy, sw, sh);
Fl_Box *box = new Fl_Box((sw-300)/2, (sh-100)/2, 300, 100,
"Hello, World!");
box->box(FL_UP_BOX);
box->labelfont(FL_BOLD+FL_ITALIC);
box->labelsize(36);
box->labeltype(FL_SHADOW_LABEL);
window->end();
window->border(0);
window->fullscreen();
window->show(argc, argv);
return Fl::run();
}
// end of fullscreen test program

This program works as expected on Windows, no matter if I uncomment the
statements sw = 600; sh = 200; as it should (IMHO).

@Manolo: how is it intended to work? window->fullscreen() should IMHO
always make the window fullscreen, no matter what size it has
originally, right? If I uncomment the size making the window smaller
then the window doesn't fill the entire screen - its size and position
are as given (0, 0, 600, 200). This is so with my current WM (Metacity)
and with the Cygwin X server on my Windows host, no matter if I use FLTK
1.3.4 or 1.4 svn.

Nimday Satria

unread,
Jul 20, 2017, 11:12:13 PM7/20/17
to fltk.general
I tried your code, and the result is fullscreen with or  without window->border(0) or any size given to width and height.

Thanks again.
Reply all
Reply to author
Forward
0 new messages