Skip to content

Commit

Permalink
implemented floatbar for x11
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Mattes committed Sep 18, 2018
1 parent 5a154dc commit 21e4804
Show file tree
Hide file tree
Showing 21 changed files with 851 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -140,3 +140,6 @@ packaging/deb/freerdp-nightly/freerdp-nightly-dbg

#
.idea

# VisualStudio Code
.vscode
1 change: 1 addition & 0 deletions client/Windows/wf_client.c
Expand Up @@ -217,6 +217,7 @@ static BOOL wf_pre_connect(freerdp* instance)
settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE;
settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = FALSE;
wfc->fullscreen = settings->Fullscreen;
wfc->floatbar_active = settings->Floatbar;

if (wfc->fullscreen)
wfc->fs_toggle = 1;
Expand Down
1 change: 1 addition & 0 deletions client/Windows/wf_client.h
Expand Up @@ -80,6 +80,7 @@ struct wf_context
int offset_y;
int fs_toggle;
int fullscreen;
int floatbar_active;
int percentscreen;
char window_title[64];
int client_x;
Expand Down
2 changes: 1 addition & 1 deletion client/Windows/wf_gdi.c
Expand Up @@ -404,7 +404,7 @@ void wf_toggle_fullscreen(wfContext* wfc)
wfc->disablewindowtracking = TRUE;
}

if (wfc->fullscreen)
if (wfc->fullscreen && wfc->floatbar_active)
floatbar_show(wfc->floatbar);
else
floatbar_hide(wfc->floatbar);
Expand Down
2 changes: 2 additions & 0 deletions client/X11/CMakeLists.txt
Expand Up @@ -36,6 +36,8 @@ set(${MODULE_PREFIX}_SRCS
xf_input.h
xf_event.c
xf_event.h
xf_floatbar.c
xf_floatbar.h
xf_input.c
xf_input.h
xf_channels.c
Expand Down
11 changes: 11 additions & 0 deletions client/X11/resource/close.xbm
@@ -0,0 +1,11 @@
#define close_width 24
#define close_height 24
static unsigned char close_bits[] =
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x7c, 0xfe, 0xff, 0x38, 0xfe, 0xff, 0x11, 0xff, 0xff, 0x83, 0xff,
0xff, 0xc7, 0xff, 0xff, 0x83, 0xff, 0xff, 0x11, 0xff, 0xff, 0x38, 0xfe,
0xff, 0x7c, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
11 changes: 11 additions & 0 deletions client/X11/resource/lock.xbm
@@ -0,0 +1,11 @@
#define lock_width 24
#define lock_height 24
static unsigned char lock_bits[] =
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xff,
0xff, 0x83, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xc7, 0xff,
0xff, 0x00, 0xfe, 0xff, 0x00, 0xfe, 0xff, 0xef, 0xff, 0xff, 0xef, 0xff,
0xff, 0xef, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
11 changes: 11 additions & 0 deletions client/X11/resource/minimize.xbm
@@ -0,0 +1,11 @@
#define minimize_width 24
#define minimize_height 24
static unsigned char minimize_bits[] =
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xfc,
0x3f, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
11 changes: 11 additions & 0 deletions client/X11/resource/restore.xbm
@@ -0,0 +1,11 @@
#define restore_width 24
#define restore_height 24
static unsigned char restore_bits[] =
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x3b, 0xff, 0x7f, 0x20, 0xff,
0x7f, 0x20, 0xff, 0x7f, 0x07, 0xff, 0x7f, 0xe7, 0xff, 0x7f, 0xe7, 0xff,
0x7f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
11 changes: 11 additions & 0 deletions client/X11/resource/unlock.xbm
@@ -0,0 +1,11 @@
#define unlock_width 24
#define unlock_height 24
static unsigned char unlock_bits[] =
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xf3, 0xff, 0xff, 0xf3, 0xff, 0xff, 0x73, 0xfe, 0xff, 0x03, 0xfe,
0x3f, 0x00, 0xfe, 0xff, 0x03, 0xfe, 0xff, 0x73, 0xfe, 0xff, 0xf3, 0xff,
0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
4 changes: 4 additions & 0 deletions client/X11/xf_client.c
Expand Up @@ -1182,6 +1182,7 @@ static BOOL xf_pre_connect(freerdp* instance)
xfc->decorations = settings->Decorations;
xfc->grab_keyboard = settings->GrabKeyboard;
xfc->fullscreen_toggle = settings->ToggleFullscreen;
xfc->floatbar = settings->Floatbar;
xf_button_map_init(xfc);
return TRUE;
}
Expand Down Expand Up @@ -1581,6 +1582,9 @@ static DWORD WINAPI xf_client_thread(LPVOID param)
nCount += tmp;
}

if (xfc->floatbar && xfc->fullscreen)
xf_floatbar_hide_and_show(xfc);

waitStatus = WaitForMultipleObjects(nCount, handles, FALSE, INFINITE);

if (waitStatus == WAIT_FAILED)
Expand Down
9 changes: 9 additions & 0 deletions client/X11/xf_event.c
Expand Up @@ -366,6 +366,9 @@ static BOOL xf_event_MotionNotify(xfContext* xfc, XEvent* event, BOOL app)
if (xfc->use_xinput)
return TRUE;

if(xfc->floatbar && !(app))
xf_floatbar_set_root_y(xfc, event->xmotion.y);

return xf_generic_MotionNotify(xfc, event->xmotion.x, event->xmotion.y,
event->xmotion.state, event->xmotion.window, app);
}
Expand Down Expand Up @@ -1014,6 +1017,12 @@ BOOL xf_event_process(freerdp* instance, XEvent* event)
}
}

if (xfc->floatbar && xf_floatbar_check_event(xfc, event))
{
xf_floatbar_event_process(xfc, event);
return TRUE;
}

xf_event_execute_action_script(xfc, event);

if (event->type != MotionNotify)
Expand Down

0 comments on commit 21e4804

Please sign in to comment.