pickled the commits

master
Allen Webster 2017-03-29 18:35:13 -04:00
parent bca15da440
commit 08eb8a7cc9
2 changed files with 11 additions and 70 deletions

View File

@ -22,9 +22,7 @@ CUSTOM_COMMAND_SIG(goto_jump_at_cursor){
View_Summary view = get_active_view(app, AccessProtected); View_Summary view = get_active_view(app, AccessProtected);
Name_Based_Jump_Location location = {0}; Name_Based_Jump_Location location = {0};
if (parse_jump_from_buffer_line(app, &global_part, if (parse_jump_from_buffer_line(app, &global_part, view.buffer_id, view.cursor.line, false, &location)){
view.buffer_id, view.cursor.line, false,
&location)){
exec_command(app, change_active_panel); exec_command(app, change_active_panel);
view = get_active_view(app, AccessAll); view = get_active_view(app, AccessAll);

View File

@ -1989,8 +1989,7 @@ LinuxScheduleStep(void)
// //
internal void internal void
LinuxSetWMState(Display* d, Window w, Atom one, Atom two, int mode) LinuxSetWMState(Display* d, Window w, Atom one, Atom two, int mode){
{
//NOTE(inso): this will only work after it is mapped //NOTE(inso): this will only work after it is mapped
enum { STATE_REMOVE, STATE_ADD, STATE_TOGGLE }; enum { STATE_REMOVE, STATE_ADD, STATE_TOGGLE };
@ -2006,23 +2005,13 @@ LinuxSetWMState(Display* d, Window w, Atom one, Atom two, int mode)
e.xclient.data.l[2] = two; e.xclient.data.l[2] = two;
e.xclient.data.l[3] = 1L; e.xclient.data.l[3] = 1L;
XSendEvent( XSendEvent(d, RootWindow(d, 0), 0, SubstructureNotifyMask | SubstructureRedirectMask, &e);
d,
RootWindow(d, 0),
0,
SubstructureNotifyMask | SubstructureRedirectMask,
&e
);
} }
internal void internal void
LinuxMaximizeWindow(Display* d, Window w, b32 maximize) LinuxMaximizeWindow(Display* d, Window w, b32 maximize)
{ {
LinuxSetWMState(d, LinuxSetWMState(d, w, linuxvars.atom__NET_WM_STATE_MAXIMIZED_HORZ, linuxvars.atom__NET_WM_STATE_MAXIMIZED_VERT, maximize != 0);
w,
linuxvars.atom__NET_WM_STATE_MAXIMIZED_HORZ,
linuxvars.atom__NET_WM_STATE_MAXIMIZED_VERT,
maximize != 0);
} }
internal void internal void
@ -2036,17 +2025,7 @@ internal void
LinuxSetIcon(Display* d, Window w) LinuxSetIcon(Display* d, Window w)
{ {
Atom WM_ICON = XInternAtom(d, "_NET_WM_ICON", False); Atom WM_ICON = XInternAtom(d, "_NET_WM_ICON", False);
XChangeProperty(d, w, WM_ICON, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)linux_icon, sizeof(linux_icon) / sizeof(long));
XChangeProperty(
d,
w,
WM_ICON,
XA_CARDINAL,
32,
PropModeReplace,
(unsigned char*)linux_icon,
sizeof(linux_icon) / sizeof(long)
);
} }
internal void internal void
@ -2394,8 +2373,7 @@ LinuxX11WindowInit(int argc, char** argv, int* WinWidth, int* WinHeight)
swa.bit_gravity = NorthWestGravity; swa.bit_gravity = NorthWestGravity;
swa.colormap = XCreateColormap(linuxvars.XDisplay, RootWindow(linuxvars.XDisplay, Config.BestInfo.screen), Config.BestInfo.visual, AllocNone); swa.colormap = XCreateColormap(linuxvars.XDisplay, RootWindow(linuxvars.XDisplay, Config.BestInfo.screen), Config.BestInfo.visual, AllocNone);
linuxvars.XWindow = XCreateWindow(linuxvars.XDisplay, RootWindow(linuxvars.XDisplay, Config.BestInfo.screen), linuxvars.XWindow = XCreateWindow(linuxvars.XDisplay, RootWindow(linuxvars.XDisplay, Config.BestInfo.screen), 0, 0, *WinWidth, *WinHeight, 0, Config.BestInfo.depth, InputOutput, Config.BestInfo.visual, CWBackingStore|CWBitGravity|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &swa);
0, 0, *WinWidth, *WinHeight, 0, Config.BestInfo.depth, InputOutput, Config.BestInfo.visual, CWBackingStore|CWBitGravity|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &swa);
if (!linuxvars.XWindow){ if (!linuxvars.XWindow){
LinuxFatalErrorMsg("XCreateWindow failed. Make sure your display is set up correctly."); LinuxFatalErrorMsg("XCreateWindow failed. Make sure your display is set up correctly.");
@ -2403,29 +2381,11 @@ LinuxX11WindowInit(int argc, char** argv, int* WinWidth, int* WinHeight)
} }
//NOTE(inso): Set the window's type to normal //NOTE(inso): Set the window's type to normal
XChangeProperty( XChangeProperty(linuxvars.XDisplay, linuxvars.XWindow, linuxvars.atom__NET_WM_WINDOW_TYPE, XA_ATOM, 32, PropModeReplace, (unsigned char*)&linuxvars.atom__NET_WM_WINDOW_TYPE_NORMAL, 1);
linuxvars.XDisplay,
linuxvars.XWindow,
linuxvars.atom__NET_WM_WINDOW_TYPE,
XA_ATOM,
32,
PropModeReplace,
(unsigned char*)&linuxvars.atom__NET_WM_WINDOW_TYPE_NORMAL,
1
);
//NOTE(inso): window managers want the PID as a window property for some reason. //NOTE(inso): window managers want the PID as a window property for some reason.
pid_t pid = getpid(); pid_t pid = getpid();
XChangeProperty( XChangeProperty(linuxvars.XDisplay, linuxvars.XWindow, linuxvars.atom__NET_WM_PID, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&pid, 1);
linuxvars.XDisplay,
linuxvars.XWindow,
linuxvars.atom__NET_WM_PID,
XA_CARDINAL,
32,
PropModeReplace,
(unsigned char*)&pid,
1
);
#define WINDOW_NAME "4coder 4linux: " VERSION #define WINDOW_NAME "4coder 4linux: " VERSION
@ -2466,13 +2426,7 @@ LinuxX11WindowInit(int argc, char** argv, int* WinWidth, int* WinHeight)
XTextProperty win_name; XTextProperty win_name;
XStringListToTextProperty(win_name_list, 1, &win_name); XStringListToTextProperty(win_name_list, 1, &win_name);
XSetWMProperties( XSetWMProperties(linuxvars.XDisplay, linuxvars.XWindow, &win_name, NULL, argv, argc, sz_hints, wm_hints, cl_hints);
linuxvars.XDisplay,
linuxvars.XWindow,
&win_name, NULL,
argv, argc,
sz_hints, wm_hints, cl_hints
);
XFree(win_name.value); XFree(win_name.value);
@ -2492,12 +2446,7 @@ LinuxX11WindowInit(int argc, char** argv, int* WinWidth, int* WinHeight)
XRaiseWindow(linuxvars.XDisplay, linuxvars.XWindow); XRaiseWindow(linuxvars.XDisplay, linuxvars.XWindow);
if (linuxvars.settings.set_window_pos){ if (linuxvars.settings.set_window_pos){
XMoveWindow( XMoveWindow(linuxvars.XDisplay, linuxvars.XWindow, linuxvars.settings.window_x, linuxvars.settings.window_y);
linuxvars.XDisplay,
linuxvars.XWindow,
linuxvars.settings.window_x,
linuxvars.settings.window_y
);
} }
if (linuxvars.settings.maximize_window){ if (linuxvars.settings.maximize_window){
@ -2926,13 +2875,7 @@ main(int argc, char **argv)
i32 *file_count; i32 *file_count;
i32 output_size; i32 output_size;
output_size = output_size = linuxvars.app.read_command_line(&linuxvars.system, &memory_vars, current_directory, &linuxvars.settings, &files, &file_count, clparams);
linuxvars.app.read_command_line(&linuxvars.system,
&memory_vars,
current_directory,
&linuxvars.settings,
&files, &file_count,
clparams);
if (output_size > 0){ if (output_size > 0){
// TODO(allen): crt free version // TODO(allen): crt free version